/// <summary> /// Send server discovery request to a remote host, not necessarily on /// the local network /// </summary> public void DiscoverKnownServer(string ipOrHostName, int serverPort) { IPAddress ip = NetUtil.Resolve(this.Log, ipOrHostName); NetMessage msg = NetDiscovery.EncodeRequest(this); SendSingleMessageAtOnce(msg, null, new IPEndPoint(ip, serverPort)); }
/// <summary> /// Connects to a server /// </summary> public bool Connect(string host, int port, byte[] customData) { IPAddress ip = NetUtil.Resolve(Log, host); if (ip == null) { return(false); } return(Connect(ip, port, customData)); }