Esempio n. 1
0
        /// <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));
        }
Esempio n. 2
0
        /// <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));
        }