SignalR client receives Information: Connection disconnected from hub

Gloria Stanciu 1 Reputation point
2022-09-20T07:03:47.39+00:00

Hi everyone,

I created a signalR JavaScript client that needs to communicate with a hosted signalR server (from Playfab). I successfully created the signalR client and connected it with the server, but the problem that I'm facing is that the connection doesn't stay open more than 30 seconds even though I subscribe to events.

Here are the messages between the client and server. After one ping, the server sends a close message.
How can I prevent this from happening?

242833-chrome-duqpncx6v1.png

Here is how the connection is created

connection = new signalR.HubConnectionBuilder()  
    .withUrl(`url`, {  
      withCredentials: false,  
      httpClient: new SignalRClient(),  
      headers: {  
        'X-EntityToken': entity.EntityToken,  
      },  
    })  
    .build()  
  
await connection.start()  
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,251 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
120 questions
{count} votes