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 do unix sockets work?
Why do I get EPROTO from read()?
How do I get my server to find out the clients address / host- name?
How many sockets can a port have?
What are raw sockets?
How can I read ICMP errors from connected UDP sockets?
What is af_inet in socket?
What is socket programming in java?
How can I force a socket to send the data in its buffer?
over the socket? Is there a way to have a dynamic buffer? What does one do when one does not know how much information is coming?
When should I use UDP instead of TCP?
When should I use shutdown()?