H
Holger Fleckenstein
Hi, I have a problem with a server socket (winsock2.h).
I do all standard stuff like listen(), accept() and so on, which all
works fine. I only want one client to be able to connect at a time and
none to be backlogged during this time. So I stop listening, as soon as
one client connects and restart doing it after the client is done.
While a client is connected the server most of the time waits [recv()]
for commands and then deals with them.
Now the actual problem is, that the clients die sometimes (for reasons
which are out of my range) and the server does not always realize this.
It just keeps sitting there waiting for commands, that never come
anymore. And for the reasons mentioned above, no other clients can
newly connect. The only thing I can do in such a situation is to kill
and restart the server.
Is there a standard way for the server to realize, when a client
connected on a socket is dead, so I can make it go back into listen
mode?
Thanks, Holger
I do all standard stuff like listen(), accept() and so on, which all
works fine. I only want one client to be able to connect at a time and
none to be backlogged during this time. So I stop listening, as soon as
one client connects and restart doing it after the client is done.
While a client is connected the server most of the time waits [recv()]
for commands and then deals with them.
Now the actual problem is, that the clients die sometimes (for reasons
which are out of my range) and the server does not always realize this.
It just keeps sitting there waiting for commands, that never come
anymore. And for the reasons mentioned above, no other clients can
newly connect. The only thing I can do in such a situation is to kill
and restart the server.
Is there a standard way for the server to realize, when a client
connected on a socket is dead, so I can make it go back into listen
mode?
Thanks, Holger