From 8010ff9e2f32e16034bcd0e7910f1950c725cc6c Mon Sep 17 00:00:00 2001 From: "Alecio Furanze (Ale)" Date: Wed, 3 Jul 2024 16:20:09 +0200 Subject: [PATCH] fix. rudp client null host --- src/rudp/partials/RUDP.ClientTo.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rudp/partials/RUDP.ClientTo.cs b/src/rudp/partials/RUDP.ClientTo.cs index c4fdd44..e6d010a 100644 --- a/src/rudp/partials/RUDP.ClientTo.cs +++ b/src/rudp/partials/RUDP.ClientTo.cs @@ -23,6 +23,7 @@ private class ClientTo : IRUDP.ClientTo public ClientTo() { + Host = Host.Default; _client = null; _socket = null; _connection = null; @@ -213,11 +214,14 @@ public void SetOpenTimeout(int value) private void InitConnection(ref Host host) { + var nextHost = host; + _connection = new Connection(host, _socket, _isServer) { OnOpen = () => { // connection opened + Host = nextHost; On.OnOpen?.Invoke(null, null); }, OnClose = () =>