... | ... | @@ -35,7 +35,7 @@ The messages or chunks are sent through the stream. After the message reading, t |
|
|
For big data, we do not know the number of chunks that will be sent to the client (the chunks are read from another file stream). Then the current protocol searches in each chunk the presence of the end sequence by comparing the bytes. When it is found, the response is considered finished.
|
|
|
However in case of a binary response, there is a small probability that a message contains the end sequence whereas it is not the end sequence.
|
|
|
One solution:
|
|
|
- start message: the name the request (can be hashed)
|
|
|
- start message: the handler's name (can be hashed)
|
|
|
- content messages interleaved with status messages: the status message tells if there is more data or not.
|
|
|
|
|
|
Thus the end message is a status message and the receiver can check only the status messages.
|
... | ... | |