Exemple #1
0
        public void SendNatIntroduceRequest(IPEndPoint masterServerEndPoint, string additionalInfo)
        {
            //prepare outgoing data
            string networkIp = NetUtils.GetLocalIp(LocalAddrType.IPv4);

            if (string.IsNullOrEmpty(networkIp))
            {
                networkIp = NetUtils.GetLocalIp(LocalAddrType.IPv6);
            }

            Send(
                new NatIntroduceRequestPacket {
                Internal = NetUtils.MakeEndPoint(networkIp, _socket.LocalPort), Token = additionalInfo
            }, masterServerEndPoint);
        }
Exemple #2
0
 public void SendNatIntroduceRequest(string host, int port, string additionalInfo)
 {
     SendNatIntroduceRequest(NetUtils.MakeEndPoint(host, port), additionalInfo);
 }