Check Internet Port Status ?
-
I want to know how to check the internet port status, becuse i want to create a TCP server application that can select the port dynamic, you know not static. For example i want to check port 1313 from ip 127.0.0.1, i want to know status (is it opened or not), if opened i want to know who is open the port. Like port scanner you know, but this for socket application. Thank's for your comments.
-
I want to know how to check the internet port status, becuse i want to create a TCP server application that can select the port dynamic, you know not static. For example i want to check port 1313 from ip 127.0.0.1, i want to know status (is it opened or not), if opened i want to know who is open the port. Like port scanner you know, but this for socket application. Thank's for your comments.
The only thing I can think of is that you try to programatically open ports in a while loop which has a try-catch inside to try to open the socket, and catch the exception and continue the loop...You can also figure out which specific exception will fire when the port is in use and only catch that one, but let other exceptions be thrown or just catch-all and assume that it's an already open-port.
-
I want to know how to check the internet port status, becuse i want to create a TCP server application that can select the port dynamic, you know not static. For example i want to check port 1313 from ip 127.0.0.1, i want to know status (is it opened or not), if opened i want to know who is open the port. Like port scanner you know, but this for socket application. Thank's for your comments.
I think you can use
Socket.Poll
for single ports andSocket.Select
for multiple ports. That wont tell you who own the port though. xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots