Listen TCp Port

  • Thread starter Thread starter sherif.elian
  • Start date Start date
S

sherif.elian

hi all

i want to listen to a port to get the data passong throught it

for example to listen to port 80 to see all data the computer is
receiveing throught the http

how can i do that in dotnet.

thanx
 
From what you've written, I can't tell if you want to receive
everything that being sent to and from port 80 on your computer or
what's being sent to/from port 80 on a remote computer between you and
him. I am assuming however from what you wrote that you would like
don't want your application to actually respond on port 80 but to just
listen to traffic that is occuring on port 80.

I believe there may be at least 2 different ways of doing this. The
first would be to use raw sockets. While this is possible, I can't
remember the first thing about doing it, and you would need to do some
searching to find a way.

The second way is to use one of the C# ports of winpcap. In the past I
used a slightly modified version of PACANAL
(http://www.codeproject.com/csharp/pacanal.asp) to accomplish this.
Unfortunately I lost the code I had written or I'd be more than glad to
share it with you. I'd reccomend checking into this.

If you'r looking to write a server that listens and responds on port
80, you need to look into using TCPListener, or Sockets. For this, look
at the documentation for System.Net and System.Net.Sockets.
 
Back
Top