On Tue, Oct 08, 2002 at 09:59:16AM -0700, Jessee Parker wrote:
> Is there a way to keep track of the number of open sockets your program
> might have that are in a TIME_WAIT (I think it is) state?

The problem is if a socket is in a TIME_WAIT state it's no longer open by
your program.  The socket has been closed, but the kernel is making the
address and port combination unavailable for a period of time, to allow for
any stray packets to be received.

Because of this, any method you use to determine if a socket is in the
TIME_WAIT will be non-portable.  Parsing netstat output, as mentioned
elsewhere in this thread, might work across most flavors of Unix, depending
on what switches you use, and how you go about parsing the output.

Why do you want to determine if a socket is in a TIME_WAIT state?  Perhaps
there's an alternative solution to your basic problem.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to