Re: Network information
Re: Network information
- Subject: Re: Network information
- From: "Peter Sichel" <email@hidden>
- Date: Tue, 19 Nov 2002 09:24:58 -0500
>
This might be a silly question, but I was wondering where I could poll the
>
system for network related information? Right now, my app makes use of
>
netstat a good bit, but I was wondering if there was a more efficient way of
>
gathering network data than piping results from an NSTask? I am interested
>
in finding connections to/from the user's cpu as well as how much traffic is
>
going through (which I don't think I can get via netstat)
Check out sysctl. There are a number of read only parameters
that provide network statistics. This is how IPNetMonitorX
retrieves the Connection List for example. You may wish to
refer to the Darwin sources for some details.
While you can use sysctl to obtain packet counts and tcp stats,
for monitoring traffic, I use an NKE that observes the actual
packets in the network datapath.
Kind Regards,
- Peter
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.