-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hi,
When two or more clients are connected, and one of them is "slow" this generates troubles with the rest.
One "slow" client is one that has some internal trouble and at some point it reads samples more slowly than the rest. Even if this is a puntual problem, as the transport protocol is TCP and the internal loop is blocking, this generates glitches in the rest of clients. Moreover, if this slow client disconnects the others continue suffering the trouble. So the only solution is disconnect all of them and reconnect.
I isolated the problem with this part of the code:
https://github.com/slepp/rtlmux/blob/master/rtlmux.c#L124
The problem seems to have only one queue of data and do writes in the TCP sockets in a blocking mode. So one idea to fix this behaviour can be: create one output queue for each client and do fast-writes to these queues from the incoming socket. Then all clients will consume from his queue and not generates troubles in the rest.
What do you think?
Regards.