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 come select says there is data, but read returns zero?
How do unix sockets work?
What pieces of information make up a socket?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?
How do I send [this] over a socket?
What is a deep well socket?
How many socket connections can a server handle?
Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?
How is a socket created?
What is socket address?
What is a socket set used for?
When will my application receive SIGPIPE?