# 체크 메소드
private static bool ConnectTest(string ip, int port) { bool result = false; Socket socket = null; try { socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, false); IAsyncResult ret = socket.BeginConnect(ip, port, null, null); result = ret.AsyncWaitHandle.WaitOne(100, true); } catch (Exception e) { System.Console.WriteLine(e); } finally { if (socket != null) { socket.Close(); } } return result; }