How do I properly close a socket?
Answer / chaitanya
This question is usually asked by people who try close(), because they have seen that that is what they are supposed to do, and then run netstat and see that their socket is still active. Yes, close() is the correct method. To read about the TIME_WAIT state, and why it is important, refer to ``2.7 Please explain the TIME_WAIT state.''.
| Is This Answer Correct ? | 0 Yes | 0 No |
of the socket? Does doing a connect() call affect the receive behaviour?
How would I put my socket in non-blocking mode?
How can I bind() to a port number < 1024?
How many sockets can a port have?
Why do we need socket programming?
How many socket connections can a server handle?
How do Sockets Work?
What is socket address?
How do unix sockets work?
What is LILO?
What's better 6pt or 12pt sockets?
What is socket address with example?