public void Connect(string hostName, string name) { Name = name; ConnectionState = Networking.ConnectionState.Connecting; Tcp.Connect(hostName); Udp.Connect(hostName); }
/// <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); }