Exemplo n.º 1
0
 public static bool CanConnect(string host, int port, TimeSpan timeout, ProtocolType protocolType = ProtocolType.Tcp)
 {
     using (var sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, protocolType)) {
         return sock.CanConnect(host, port, timeout);
     }
 }