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 |
What is socket address with example?
Why sockets are used?
Is a socket a file?
What is a deep well socket?
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?
Is socket a hardware or software?
Are unix sockets faster than tcp?
What is a socket api?
How can I bind() to a port number < 1024?
When should I use UDP instead of TCP?
What does af mean in sockets?
What is af_inet in socket?