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 |
What is the difference between SO_REUSEADDR and SO_REUSEPORT?
Are unix sockets faster than tcp?
What pieces of information make up a socket?
How can I write a multi-homed server?
How are unix domain sockets implemented?
How can I bind() to a port number < 1024?
What exactly is a socket?
How do I send [this] over a socket?
How can my client work through a firewall/proxy server?
of the socket? Does doing a connect() call affect the receive behaviour?
How do I properly close a socket?
What's the difference between a socket and a port?