For simple purposes, just try connecting to each port and reporting success / failure without any “tricks”, for example, send only ACK packets, etc. - you will not need anything except System.Netand System.Net.Sockets, create a socket, try connecting to the host, check if you managed to do this. To improve performance, you can create more sockets and use the asynchronous approach (BeginConnect / EndConnect).
source
share