What exactly does SO_REUSEADDR do?



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

Post New Answer

More Unix Socket Programming Interview Questions

What's better 6pt or 12pt sockets?

0 Answers  


Why does it take so long to detect that the peer died?

0 Answers  


What is difference between socket () and serversocket () class?

0 Answers  


Why do I get connection refused when the server is not running?

1 Answers  


Why do we need socket programming?

0 Answers  






How do I use TCP_NODELAY?

0 Answers  


How can I put a timeout on connect()?

1 Answers  


How do I properly close a socket?

1 Answers  


How should I choose a port number for my server?

1 Answers  


What is the purpose of socket?

0 Answers  


Why do we need sockets?

0 Answers  


What are Sockets?

1 Answers  


Categories