Talk:Chat server

From Rosetta Code
Revision as of 16:44, 15 January 2011 by rosettacode>Paul.miner (Clarification about broadcasting requested.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

It seems to me that there is the possibility that a slow/faulty connection could delay anyone sending messages. Suppose there are 4 people on the server, A, B, C and D. If B's connection is screwy, then any time A, C or D attempt to send a message, the server will either block on the broadcast to B, or the message will not be sent completely. Looking at the Python implementation, I see that connection is set to non-blocking, so the default behavior is the latter (incomplete message). I don't know about the other implementations, but I think this behavior should be clarified. Should one bad connection be able to disable the communications for the whole server, and is one slow connection receiving incomplete messages acceptable?

The proper way to handle this would be have a thread or threads to handle broadcasting to ensure that messages sent are complete and that they don't delay normal input processing, but maybe this is beyond the scope of the problem? --Paul.miner 16:44, 15 January 2011 (UTC)