|
For broadcasting i don't think a multitthreaded server is a good way.
For example 2 people broadcast a message and the server opens 2 threads to send to the clients. Then they could cought up by both sending a message to 1 person and the client will choke or shows 2 popups rapidly fast.
In my opinion the server should have a thread safe queue list for all recieved message.
(recieve message multithreaded, but don't send them at the same time)
And another process/timer sends the queued messages all at once or one at a time.
If it's used on high traffic networks you should send all messages at once to the client.
|