Skip to content

Commit

Permalink
fix. rudp client null host
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed Jul 3, 2024
1 parent 76c663b commit 8010ff9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rudp/partials/RUDP.ClientTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private class ClientTo : IRUDP.ClientTo

public ClientTo()
{
Host = Host.Default;
_client = null;
_socket = null;
_connection = null;
Expand Down Expand Up @@ -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 = () =>
Expand Down

0 comments on commit 8010ff9

Please sign in to comment.