When trying to do a user count I get the error web socket is not in open state, I have Saaskit as well for mutitenancy could that be the cause?
I have tried specifieng UseWebsockets in the startup.cs with no luck
{
private static int UserCount;
public override Task OnConnectedAsync()
{
UserCount++;
base.OnConnectedAsync();
this.Clients.All.SendAsync("updateUserCount", UserCount);
return Task.CompletedTask;
}
public override Task OnDisconnectedAsync(Exception exception)
{
UserCount--;
base.OnDisconnectedAsync(exception);
this.Clients.All.SendAsync("updateUserCount", UserCount);
return Task.CompletedTask;
}
}```
```<script>
document.addEventListener('DOMContentLoaded', function () {
}
function onConnectionError(error) {
if (error && error.message) {
console.error(error.message);
}
}
var connection = new
signalR.HubConnectionBuilder().withUrl('/adminHub')
.configureLogging(signalR.LogLevel.Debug).build();
connection.start()
.then(function () {
onConnected(connection);
})
.catch(function (error) {
console.error(error.message);
});
});
</script>```
Debug: Sending handsha`enter code here`ke request.
Debug: Hub handshake failed with error 'WebSocket is not in the OPEN state' during start(). Stopping HubConnection.
HttpConnection.stopConnection(undefined) called while in state Disconnecting.
Connection disconnected with error 'WebSocket is not in the OPEN state'.
HubConnection.connectionClosed(WebSocket is not in the OPEN state) called while in state Connecting.