Why do not my sockets close?
Answer / 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 |
What is the difference between a socket and a port?
What does af mean in sockets?
How can I be sure that UDP messages are received in order?
How can I bind() to a port number < 1024?
What is Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
After the chroot(), calls to socket() are failing. Why?
What are the types of sockets?
How is a socket created?
When should I use UDP instead of TCP?
What is with the second parameter in bind()?
How can I listen on more than one port at a time?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?