.NET Framework Bookmark and Share   
 index > .NET Framework Networking and Communication > Detecting Open Ports
 

Detecting Open Ports

I am trying to figure out a way to determine if there are any sockets listing on any ports. For example, I have a server that creates a socket, before I start listing, I want to check to see if this port is already in use, are the any system call that allow me to get that information? This should be simple, but i have not been abel to figure this out.... I am using vb.net.

ko712000

open a socket and send a message on the port you want to check. if it's one of the well known ports, you'llknow what message to send (for example on 80 you can send a "get" message).

if you get a reply, you'll know that an app listens on that port. if youyou get an exception, you'll know that the port is closed.

Later edit: http://www.geekpedia.com/tutorial142_Creating-a-Port-Scanner-with-Csharp.html

naicul
Thanks. I was trying to avoild through a exception and hoping I could make a system call to check if the port is in use.
ko712000

You can use google to search for other answers

Custom Search

More Threads

• It's illogical, Captain
• CDOSYS ASP.NET authenticated email script
• Large File Download
• get system restore status on drives
• video streaming
• Problem with "Access is denied" or Status 500 - FailedAuthentication
• Move-MailBox error in Exchange 2007
• Problem: WebRequest.Create("http://test.url.de") hang
• Getting a file list from an HTTP server
• How to cancel a WebRequest immediately