----- Original Message ----
From: Justin C. Walker <email@hidden>
To: MacNetwork Programming <email@hidden>
Sent: Thursday, June 5, 2008
12:25:58 AM
Subject: Re: tcp connection state information
On Jun 4, 2008, at 19:09 , Tom Gissel wrote:
> Is there a way to list all the connections and the state for a
> particular port/socket? Specifically I'm interested in getting the
> information for TCP connections and seeing what state those
> connections are in LISTEN/ESTABLISHED/TIME_WAIT/etc, like netstat/
> lsof display. I realize that I could execute either these commands
> and parse the output but both commands have prohibitive cost
> associated with them. lsof is particularlly slow, on my 2.6 gz
> macbookpro "lsof -F -i tcp:8081" takes it ~1.187 seconds to execute.
> netstat is significantly faster, especially with the -n option, so
> it must be doing a lot less work...
Is there a reason you don't look at the 'netstat' source?
Justin
--
Justin C. Walker,
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden