... | ... | @@ -41,6 +41,10 @@ The main functions of *StreamDispatcher* are: |
|
|
* sendString: Sends a string to a specific handler.
|
|
|
* sendStream: Sends a stream.
|
|
|
|
|
|
The function *setHandler* is used with *stringCollector* or *stringCollectorGenerator* and there are two ways to use:
|
|
|
* The handler is set once for many streams or requests. That is the case on the server side. In that case the handler generator is recalled after each end of stream. Here a function returning a stream is called.
|
|
|
* The handler is set once for one single stream or request. That is the case on the client side because it is necessary to synchronize the end of the handler execution. Here *stringCollectorGenerator* is called.
|
|
|
|
|
|
#### Limitations and improvements
|
|
|
|
|
|
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.
|
... | ... | |