471,605 Members | 1,503 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Monitor a socket port

Is there a way to monitor the amount of data that is sent/received over one
port on a socket? I don't care about the data just the number of bytes.

Regards,
John
Feb 8 '06 #1
5 3410
Depends.
If you want to monitor port over which you are sending / receiving data ,
it's relatively simple. Just count bytes.

If you want monitor port connected with other process you can google about
WinpCap
It comes with handy documentation.
Feb 9 '06 #2
Hello, John!

JJH> Is there a way to monitor the amount of data that is sent/received
JJH> over one port on a socket? I don't care about the data just the
JJH> number of bytes.

AFAIK to know this you have to write unmanaged software called LSP ( Layered Service Provider ) that will collect traffic data for specific port. LSP is only for sockets, if you want all data from non-socket communications you have to use/write kernel-mode driver.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 9 '06 #3
Well I wrote the program so in concept yes I can just count bytes. The
problem is I start a thread for each socket handle on the port and would
like the cumulative count port rather then the count for the handle on one
thread. I was sort of hoping for an overload of the byte received/sent for
the port.

Thanks for the program name.

Regards,
John

"PiotrKolodziej" <pi*************@gmail.com> wrote in message
news:18*************************@news.chello.pl...
Depends.
If you want to monitor port over which you are sending / receiving data ,
it's relatively simple. Just count bytes.

If you want monitor port connected with other process you can google about
WinpCap
It comes with handy documentation.

Feb 9 '06 #4
Thanks, that gives me a start. I was hoping for something from .NET but the
trace function seems more decated to getting the data then the count of
bytes.

Regards,
John

"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:ea**************@TK2MSFTNGP15.phx.gbl...
Hello, John!

JJH> Is there a way to monitor the amount of data that is sent/received
JJH> over one port on a socket? I don't care about the data just the
JJH> number of bytes.

AFAIK to know this you have to write unmanaged software called LSP (
Layered Service Provider ) that will collect traffic data for specific
port. LSP is only for sockets, if you want all data from non-socket
communications you have to use/write kernel-mode driver.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Feb 9 '06 #5
If i were you i'd try with WinPcap.
It's necesesary thing for many port sniffers ( f.e: Ethereal ), that obrain
many data from the ports.

PK
Feb 9 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Scott Robinson | last post: by
reply views Thread by Danny Jensen | last post: by
4 posts views Thread by DreJoh | last post: by
1 post views Thread by Rolln_Thndr | last post: by
3 posts views Thread by Robert A. van Ginkel | last post: by
5 posts views Thread by John Sheppard | last post: by
2 posts views Thread by Droopy | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.