I'm implementing in c a sort of FTP protocol.
I' ve a server running.
I start the client, connect to the server, and then send a
When a socket is closed, it enters the
TIME WAIT state (see here for the possible TCP states) and no other socket can be bound to the same address/port pair until the socket leaves
TIME WAIT and is in the
You can go around this by setting the
SO_REUSEADDR socket option, that will allow two sockets to be bound to the same address if one of the sockets is in the
TIME WAIT state.