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 |
How is a socket created?
Why do I get EPROTO from read()?
Where can a get a library for programming sockets?
What does af mean in sockets?
How do I convert a string into an internet address?
How do I get the port number for a given service?
Whats the difference between select() and poll()?
How come select says there is data, but read returns zero?
What is the function of socket?
How do unix sockets work?
If bind() fails, what should I do with the socket descriptor?
What is the difference between close() and shutdown()?