In C#, how to check if a TCP port is available?

Posted by Ali on Stack Overflow See other posts from Stack Overflow or by Ali
Published on 2009-02-20T15:53:37Z Indexed on 2010/05/08 7:48 UTC
Read the original article Hit count: 397

Filed under:
|
|
|

In C# to use a TcpClient or generally to connect to a socket how can I first check if a certain port is free on my machine?

more info: This is the code I use:

TcpClient c;
//I want to check here if port is free.
c = new TcpClient(ip, port);

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET