Why direct sockets used instead of SocketServer ?
Ekstazi opened this issue · comments
This was afaik done for performance reasons, in particular all incoming client connections are (nearly) permanently alive and we just disable watching when our internal buffer limit gets reached.
It's in the end a lot of objects and enabling back and forth (if you consider ResourceInputStream->read() for example).
And this is in the hot path of the server...
p.s.: We technically could use the SocketServer API for accepting, but we'd definitely then have to unwrap the raw resource after accepting for performance. Also note that we have a common function for accepting from all bound sockets. With the socket server API you'd have essentially as many generators as server sockets…
It seems like all questions have been answered. If not, please respond with further questions, the issue can always be re-opened. 👍