Protogame.DefaultHiveNATPunchthrough.StartBackgroundNATPunchthrough C# (CSharp) Méthode

StartBackgroundNATPunchthrough() public méthode

public StartBackgroundNATPunchthrough ( TempSessionWithSecrets userSession ) : Task
userSession TempSessionWithSecrets
Résultat Task
        public async Task<BackgroundNATPunchthrough> StartBackgroundNATPunchthrough(TempSessionWithSecrets userSession)
        {
            var udpClient = new UdpClient();
            
            // Do the first operation inline, because we need to send at least one packet to
            // give the UDP client a port.
            await PerformNATPunchthroughInternal(userSession, udpClient, 60000);
                        
            var backgroundPunchthrough = new BackgroundNATPunchthrough(userSession, udpClient);
            var thread = new Thread(() => ContinuousNATPunchthrough(backgroundPunchthrough));
            thread.Name = "NAT Punchthrough";
            thread.IsBackground = true;
            thread.Start();
            return backgroundPunchthrough;
        }

Same methods

DefaultHiveNATPunchthrough::StartBackgroundNATPunchthrough ( TempSessionWithSecrets userSession, UdpClient udpClient ) : Task