2 tcp/ip questions

  • Thread starter Thread starter Nikola Skoric
  • Start date Start date
N

Nikola Skoric

Hello all,

How do I determine if a port is open for communication? TcpClient class
doesn't seem to have a method for determening wether anybody is listening
on specified port of specified machine... so if I just do the Connect(IP,
port) and nobody's listening, nothing happens... or, to be precise, even
worse, the method just hangs.

And my second question: How do I determine my current IP adress? The
documentation isn't quite clear on that matter...
 
To answer this part ..

---------
How do I determine if a port is open for communication? TcpClient class
doesn't seem to have a method for determening wether anybody is listening
on specified port of specified machine... so if I just do the Connect(IP,
port) and nobody's listening, nothing happens... or, to be precise, even
worse, the method just hangs.
---------

So I guess what you are trying to do is try and detect if a service running
on a specified machine is listening on a port or not .. right? You have to
program around that, and put that process on another thread along with a
timeout for the request.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
Back
Top