Answer Posted / chaitanya
When you issue the close() system call, you are closing your interface to the socket, not the socket itself. It is up to the kernel to close the socket. Sometimes, for really technical reasons, the socket is kept alive for a few minutes after you close it. It is normal, for example for the socket to go into a TIME_WAIT state, on the server side, for a few minutes. People have reported ranges from 20 seconds to 4 minutes to me. The official standard says that it should be 4 minutes. On my Linux system it is about 2 minutes. This is explained in great detail in ``2.7 Please explain the TIME_WAIT state.''.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
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?
Why sockets are used?
What is a socket set used for?
What is difference between socket and websocket?
Are unix sockets faster than tcp?
What is socket address with example?
Is socket a hardware or software?
What are the pros/cons of select(), non-blocking I/O and SIGIO?
How do I convert a string into an internet address?
What is a socket file?
What's the difference between impact sockets and regular sockets?
What's better 6pt or 12pt sockets?
How does unix socket work?
Where is the socket located?
How do I use TCP_NODELAY?