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); }
public void SendNatIntroduceRequest(string host, int port, string additionalInfo) { SendNatIntroduceRequest(NetUtils.MakeEndPoint(host, port), additionalInfo); }