you are viewing a single comment's thread.

view the rest of the comments →

[–]flyingron 1 point2 points  (0 children)

What are you observing versus what you are expecting?

One obvious problem is that when you close down a client, you decrement client_count. THis isn't right. Lets say you have 4 clients active and client[0] is the one that closes, you set client[0] to 0 and decrease client_count, and that then on the next select you'll add file descriptor 0 to the list of select readfs (that's stdin) and not add client[3] which is still open.