How come I get address already in use from bind()?
Answer / chaitanya
You get this when the address is already in use. (Oh, you figured that much out?) The most common reason for this is that you have stopped your server, and then re-started it right away. The sockets that were used by the first incarnation of the server are still active. This is further explained in ``2.7 Please explain the TIME_WAIT state.'', and ``2.5 How do I properly close a socket?''.
| Is This Answer Correct ? | 0 Yes | 0 No |
Are unix sockets faster than tcp?
Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?
Why do not my sockets close?
How many socket connections can a server handle?
How can I listen on more than one port at a time?
What is the difference between close() and shutdown()?
If bind() fails, what should I do with the socket descriptor?
What is af_inet in socket?
How should I choose a port number for my server?
Is tcp or unix socket faster?
What exactly does SO_KEEPALIVE do?