problem with client-server
I have implemented client-server programming using TCP sockets.read and write works fine between client and server but when i close client with ctrl-c then server stops with broken pipe.what may be the problem. I have implemented server using select() system call.how can i check client is no more connected and server is still running and again it will wait for client ???
|
Moved to Programming because I think you'll have better luck there.
|
When a client disconnects, select() will place that descriptor in the readset. I imagine that after select() returns you loop through the descriptors and read from the ones that are left in the readset. When you read from the descriptor that disconnected, read() will return 0.
|
All times are GMT -5. The time now is 09:18 AM. |