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 does af mean in sockets?
Can multiple clients connect to same socket?
What is difference between socket and websocket?
How does a socket work?
Explain the TIME_WAIT state.
What is a socket connection?
When should I use UDP instead of TCP?
What is a socket address?
What exactly is a socket?
What is sae socket?
How many sockets can a port have?
Whats the difference between select() and poll()?