Unix Socket Programming Question:

Download Job Interview Questions and Answers PDF

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

Unix Socket Programming Interview Question
Unix Socket Programming Interview Question

Answer:

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?''.

Download Unix Socket Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How can I make my server a daemon?Why do I get connection refused when the server is not running?