How come I get address already in use from bind()?



How come I get address already in use from bind()?..

Answer / chaitanya

You get this when the address is already in use. (Oh, you figured that much out?) The most common reason for this is that you have stopped your server, and then re-started it right away. The sockets that were used by the first incarnation of the server are still active. This is further explained in ``2.7 Please explain the TIME_WAIT state.'', and ``2.5 How do I properly close a socket?''.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Socket Programming Interview Questions

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

1 Answers  


What is a deep well socket?

0 Answers  


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

1 Answers  


What is af_inet in socket?

0 Answers  


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

1 Answers  






of the socket? Does doing a connect() call affect the receive behaviour?

1 Answers  


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?

1 Answers  


What is the difference between close() and shutdown()?

1 Answers  


What is the difference between a socket and a port?

0 Answers  


How do I convert a string into an internet address?

0 Answers  


What is socket programming in java?

0 Answers  


How can I set the timeout for the connect() system call?

0 Answers  


Categories