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 |
How do I properly close a socket?
How many sockets can a cpu have?
How many sockets can a port have?
What exactly does SO_REUSEADDR do?
What exactly does SO_KEEPALIVE do?
How come I get address already in use from bind()?
How do I get my server to find out the clients address / host- name?
How are unix domain sockets implemented?
What is a socket api?
What exactly is a socket?
Whats the difference between select() and poll()?
When should I use shutdown()?