private bool TryBindSocket(Socket socket, IPAddress address, int port) { if(null != socket && null != address) { try { socket.Bind(new IPEndPoint(address, port)); if(socket.IsBound) { return true; } } catch { } } return false; }