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

How do I send [this] over a socket?

1 Answers  


How can I listen on more than one port at a time?

1 Answers  


Why sockets are used?

0 Answers  


Why do we need sockets?

0 Answers  


How do unix sockets work?

0 Answers  






What are socket exceptions? What is out-of-band data?

1 Answers  


What is the function of socket?

0 Answers  


How many sockets can a port have?

0 Answers  


What is LILO?

2 Answers  


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 are raw sockets?

4 Answers   Axis Technologies,


Why does connect() succeed even before my server did an accept()?

1 Answers  


Categories