What exactly does SO_REUSEADDR do?
Answer / chaitanya
This socket option tells the kernel that even if this port is busy (in the TIME_WAIT state), go ahead and reuse it anyway. If it is busy, but with another state, you will still get an address already in use error. It is useful if your server has been shut down, and then restarted right away while sockets are still active on its port. You should be aware that if any unexpected data comes in, it may confuse your server, but while this is possible, it is not likely.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why do we need socket programming?
What's the difference between impact sockets and regular sockets?
How can I listen on more than one port at a time?
Why do I get connection refused when the server is not running?
How can I read only one character at a time?
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?
What are the types of sockets?
What is the difference between close() and shutdown()?
What are raw sockets?
How to find other end of unix socket connection?
What is Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
What is difference between socket and websocket?