Unix Programming - What is the best way to program socket staticstics?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2007 > What is the best way to program socket staticstics?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author What is the best way to program socket staticstics?
Owen Zhang

2007-09-27, 7:37 pm

I am working on a project that counts the incoming and outgoing
messages on a certain port. I know "nestat" may be able to do it. But
is there any programmable way to get this data like "ioctl"? I am
working on Solaries 5.9. Thanks.

Frank Cusack

2007-09-27, 7:37 pm

On Thu, 27 Sep 2007 13:35:37 -0700 Owen Zhang <owenzhang.chicago@gmail.com> wrote:
> I am working on a project that counts the incoming and outgoing
> messages on a certain port. I know "nestat" may be able to do it. But


I'm pretty sure netstat can't report per-port statistics.

> is there any programmable way to get this data like "ioctl"? I am
> working on Solaries 5.9. Thanks.


I don't think so. With Solaris 10 you can use dtrace. Earlier
versions I think you'd have to use snoop or tcpdump.

-frank
Owen Zhang

2007-09-28, 1:24 pm

I don't need the content of the packets. Intead I just need to count
the number of the packets.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com