• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: tcp connection state information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tcp connection state information


  • Subject: Re: tcp connection state information
  • From: Tom Gissel <email@hidden>
  • Date: Thu, 5 Jun 2008 05:43:08 -0700 (PDT)

Interesting idea, that had not occurred to me. I'm new to developing on OS X, where exactly would I get the netstat source from and  what license is associated with that code? I'm guessing it is some variant on one of the BSD based netstats?

Thanks,
Tom

----- 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

  • Prev by Date: Re: tcp connection state information
  • Next by Date: Deleting a TCP connection in Mac OS X
  • Previous by thread: Re: tcp connection state information
  • Next by thread: Re: Deleting a TCP connection in Mac OS X
  • Index(es):
    • Date
    • Thread