Example #1
0
        public void Connect(string hostName, string name)
        {
            Name = name;

            ConnectionState = Networking.ConnectionState.Connecting;
            Tcp.Connect(hostName);
            Udp.Connect(hostName);
        }
Example #2
0
            /// <summary>
            ///     Connects the client using the UDP protocol.
            /// </summary>
            public void ConnectUdp()
            {
                var tcpClient     = _tcp.TcpClient;
                var client        = tcpClient.Client;
                var localEndPoint = client.LocalEndPoint;
                var ipEndPoint    = (IPEndPoint)localEndPoint;
                var port          = ipEndPoint.Port;

                Logger.Log($"Attempt UDP Connection on IP: {ipEndPoint}, Port: {port} ", Color.blue, "Client");
                _udp = new Udp(Configs);
                _udp.Connect(port);
            }