Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!