Debug signalr
This commit is contained in:
@@ -8,9 +8,9 @@
|
|||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.Hosting.Lifetime": "Error",
|
"Microsoft.Hosting.Lifetime": "Error",
|
||||||
"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information",
|
"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information",
|
||||||
"System.Net.Http.HttpClient": "Error"
|
"System.Net.Http.HttpClient": "Error",
|
||||||
//"Microsoft.AspNetCore.SignalR": "Debug",
|
"Microsoft.AspNetCore.SignalR": "Debug",
|
||||||
//"Microsoft.AspNetCore.Http.Connections": "Debug"
|
"Microsoft.AspNetCore.Http.Connections": "Debug"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ApiKeys": {
|
"ApiKeys": {
|
||||||
|
|||||||
@@ -23,6 +23,19 @@ public class GameHubNode : IAsyncDisposable
|
|||||||
options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets;
|
options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets;
|
||||||
})
|
})
|
||||||
.Build();
|
.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;
|
public bool IsConnected => this.hubConnection.State == HubConnectionState.Connected;
|
||||||
|
|||||||
Reference in New Issue
Block a user