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 |
When should I use shutdown()?
Why do I get EPROTO from read()?
What is af_inet in socket?
Why do I get connection refused when the server is not running?
What does af mean in sockets?
Why does it take so long to detect that the peer died?
What is with the second parameter in bind()?
What are raw sockets?
What are the pros/cons of select(), non-blocking I/O and SIGIO?
How often should I re-transmit un-acknowleged messages?
What is a deep well socket?
What's better 6pt or 12pt sockets?