]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
Initialize the keep-alive timer before sending packets
authorMatthew Endsley <mendsley@gmail.com>
Wed, 3 Feb 2021 09:14:36 +0000 (01:14 -0800)
committerMatthew Endsley <mendsley@gmail.com>
Wed, 3 Feb 2021 22:40:53 +0000 (14:40 -0800)
Hazel/Udp/UnityUdpClientConnection.cs

index 19256ab29fca1494ca25e99486a48fb11cacbc63..eb9264bc49cd517bf206acd13dfefff681a7816b 100644 (file)
@@ -135,14 +135,14 @@ namespace Hazel.Udp
                 throw new HazelException("A SocketException occurred while initiating a receive operation.", e);
             }
 
+            this.InitializeKeepAliveTimer();
+
             // Write bytes to the server to tell it hi (and to punch a hole in our NAT, if present)
             // When acknowledged set the state to connected
             SendHello(bytes, () =>
             {
                 this.State = ConnectionState.Connected;
             });
-
-            this.InitializeKeepAliveTimer();
         }
 
         /// <summary>