Debug signalr

This commit is contained in:
2024-08-26 19:58:28 -05:00
parent 9a362a514e
commit 6c728df4ac
2 changed files with 16 additions and 3 deletions

View File

@@ -23,6 +23,19 @@ public class GameHubNode : IAsyncDisposable
options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets;
})
.Build();
this.hubConnection.Closed += this.HubConnection_Closed;
}
private Task HubConnection_Closed(Exception? arg)
{
Console.WriteLine("SignalR connection closed");
if (arg != null)
{
Console.WriteLine("Because {0}", arg.Message);
}
return Task.CompletedTask;
}
public bool IsConnected => this.hubConnection.State == HubConnectionState.Connected;