Okay, I\'ve read this post in search for the right answer, but it does not seem to serve my purpose.
This Question
Now, getting to the trouble:
I have a
sockets cannot be reused.
Once the connection a socket served has gone down in both directions, the socket is unusable.
close()
the client socket on loss of connection and create a new socket for a new connection.
Update (based on the comments below):
In the OP's case one side (the server side) went down (by means of the server process ending). This implies all sockets held by this process are implicitly close()
ed and therefore shutdown()
in both directions.