Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
How can i close circuit beetwen client and server-side in BlazorServer?

I want to close the circuit from the server-side when a user is inactive for a long time. The connection must be terminated to save Azure SignalR resources.

I have created a js-script, simple timer that tracked onmousemove and onkeypress events and calls C# method when time has expired.

function CloseCircuit()
{
    dotNetHelper.invokeMethodAsync('CloseCircuit');
}

I've read about the CircuitHandler implementation, but I don't need to handle the event of closing or opening a connection. I have to somehow initiate the closing of this connection from my BlazorServer app. I'd appreciate any advice

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If you are using SignalR Core, you can use the Context.Abort() available via the Hub class. E.G:

   public class MyHub : Hub
    {
        public void CloseCircuit()
        {
            // This will close the connection of the caller
            Context.Abort();
        }
    }

If you are not using SignalR core, I believe there is no way to do this yet. In that case, why not just stop the connection from the client side, because you are already doing the timer there?

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda