Question

The title says it all, but here's a more in-depth explanation: I made a chat server for some of my friends and I, but one of the last issues I need to iron out is that when one of them disconnects, there's no available indication of this to the others connected to the server. I'm planning to start a separate thread that makes sure some specific data is sent to the server every minute or so (sending of data also automated on the client side) to keep each client in-check. If one were to not send data for a certain amount of time, it would be discarded as "disconnected." The problem is, the way my program is set up, it would be impossible to discern whether they both were receiving data without dismantling most of the code already there.

Help is greatly appreciated, ~P

Was it helpful?

Solution

Two recv() threads, non-blocking, same socket: do both receive a sent buffer?

No, but they would both receive the EOS indication (return value is zero).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top