* various fixes to readable-stream implementation using blocking srt calls. - refactor reading/pushing routine in order to allow higher througput: * call srt read() in the same tick/stack as the class _read impl call * schedule a timer only as needed if no connection yet or socket buffer empty * blocking loop to push all bytes requested, or until push returns false or until no more data is in the socket buffer * generally, handle case properly where no data is yet available from srt-socket read() * in case no more data, retains the currently requested value remainder from last _read call -> this will allow for getting as much data as requested (if socket delivers it) within the tick where it was requested or any next one in a best effort manner. it will block the main-thread with "too long" execution frames/ticks eventually as the data-demand from the _read calls becomes high in amout/frequency. but that is simply a consequence of the fact the SRT calls here are blocking I/O. the previous implementation was also resulting in this congestion of the main loop queue as read calls would block it, but at best there was a 100ms lag between a request for read and its actual fulfillment. one further improvement of this fix could be to split up the requested bytes amount onto several ticks (executing one partial read directly, and further ones in further timer scheduled calls, in order to avoid blocking ticks). - use 50ms timer default for read continuation retry timer - use 50ms interval for initial connection epoll'ing - use consts for all timeout values - implement base class _destroy method & refactor close() in consequence - trigger Stream base class "readable" event on connection and first packet * server: add an event for when a client was accepted to pass the fd |
||
|---|---|---|
| .. | ||
| async-worker.js | ||
| async.js | ||
| binding.cc | ||
| node-srt.cc | ||
| node-srt.h | ||
| server.js | ||
| srt-enums.h | ||
| stream.js | ||