Simple TIME_WAIT question

iksrazal_at_terra.com.br
Date: 06/28/05


Date: 28 Jun 2005 05:35:03 -0700

Hi all,

I've been trying to close a socket and I think it is closing now. Using
'netstat -an' I see:

tcp 0 0 127.0.0.1:1786 127.0.0.1:25
CLOSE_WAIT

Then:

tcp 0 0 127.0.0.1:25 127.0.0.1:1786
TIME_WAIT

My questions are:

1) Is it normal for a socket to transition from CLOSE_WAIT to TIME_WAIT
when the local application clears the CLOSE_WAIT condition - ie, closes
the socket?

2) What is the purpose of TIME_WAIT in Linux?

iksrazal



Relevant Pages

  • Re: Correlating open sockets with processes
    ... I know I can use netstat to view open sockets on a machine and I know I can use ps to view processes running on a machine, but I'm not sure how to tie the two together. ... For example, if I see something running on socket 444, how do I find out what process opened/owns that socket? ... on Linux the -p option to netstat will include the process info in the list of each socket. ... I would mostly need this information for RH/CentOS Linux and Solaris 8/9/10. ...
    (comp.unix.admin)
  • Re: threading support in python
    ... that doing so is actually sloppy practice ... For files, maybe closing them is ... wire when the socket shuts down) it's less appealing. ...
    (comp.lang.python)
  • [PATCH] knfsd: Fix a race in closing NFSd connections.
    ... There is a bug introduced in 2.6.19 that can cause badness in the NFS ... server, particularly if you get clients closing connections while the server ... This patch fixed the bug and improves the handling of socket closing. ...
    (Linux-Kernel)
  • Re: Select with a socket and timeout
    ... My problem is when closing the connection (using shutdown et close call to the socket), it is effective only after the timeout. ... My connection is TCP Client and only receiving data. ... If you are doing a close on a socket descriptor from one thread while it's ...
    (comp.programming.threads)
  • Re: [C# .NET 2.0] Weird behaviour with Close method of TcpClient class
    ... But if I remove the finally block (NetworkStream and TcpClient ... I believe that the more general problem is that the original code is not calling Socket.Shutdown() before disposing/closing the stream and socket. ... but my recollection is that closing an open socket results in a "reset" of the connection while a shutdown results in a "graceful closure" of the connection. ...
    (microsoft.public.dotnet.languages.csharp)