I use a server-client architecture using tcp-ip connections.
If I listen on server for a connection and a client ask for a connection, then I need to close the connection on client.
If the client close for any reason, then the server close the connection and listen again for a new connection on the same port and the same address.
If the client doesn't close the connection, then there is a strange behaviour:
- if the server doesn't listen, then the client connect to a ghost listener.
- if the client doesn't ask for a connection, the listener creates a connection and then it receives 66 error.
How could I be robust to a client or server crashes?