Hi all,
Just started diving into System.Net and System.Net.NetworkInformation. I want to write an app that detects when packets start to move over various protocols/ports. For example, I'd like a component in the app to raise an event when outbound packets are sent over port 80.
I've looked over the various client and listener types in System.Net and System.Net.Sockets, but they're all concerned with providing client server functionality. I just want to attach to existing connections. Is there a managed way to do this
Thanks in advance,
Jim

Detecting traffic on various Protocols/Ports
Ben_Pittoors
That said, if you want to receive all IP packets on a link for inspection see the socket IOCTL SIO_RCVALL. This option is availalbe on win 2000 and later OSs. See:
http://msdn.microsoft.com/library/en-us/winsock/winsock/wsaioctl_2.asp frame=true
khushboo Sharan
The short answer is no.
The long answer is that monitoring traffic can't be done unless you do
1. Layered Winsock service providers
2. TDI filters
or in Windows Vista using the Windoes Filtering Platform.
None of these are exposed in managed code. Monitoring packets is not as easy as you think. You need to understand various network protocols headers and checksums, IPSec etc to make sense of what is going on.