SignalR overwriting OnConnected(), OnDisconnected()


Problem:

I'm trying to overwrite OnConnected(), OnDisconnected() methods but I get:

OnConnected()': no suitable method found to override

Is implementing IDisconnect, IConnect interfaces and doing my processing within Connect() and Disconnect() the same as OnConnected(), OnDisconnected()?

what gives?

public static class UserHandler
{
    public static HashSet<string> ConnectedIds = new HashSet<string>();
}

public class MyHub : Hub
{
    public override Task OnConnected()
    {
        UserHandler.ConnectedIds.Add(Context.ConnectionId);
        return base.OnConnected();
    }

    public override Task OnDisconnected()
    {
        UserHandler.ConnectedIds.Remove(Context.ConnectionId);
        return base.OnDisconnected();
    }
}

Solution:

This code worked for me until this morning when I upgraded SignalR from 2.1.0 to 2.1.1, and now I get "no suitable method found to override" for OnDisconnected(). I believe it needs to be written like this instead to account for a new parameter:

public override Task OnDisconnected(bool stopCalled = true) 
{
   UserHandler.ConnectedIds.Remove(Context.ConnectionId);
   return base.OnDisconnected(stopCalled); 
}

Recent Tips

  1. DatePickerDialog displays with two borders
  2. "type 'double' is not a subtype of type 'int' in type cast" error in flutter. What should i do?
  3. hiding the autocomplete list when user click outside the textbox is not working as expected
  4. JSF IceFaces basic problem with redisplaying input value
  5. How to validate material ui TextField in reactjs?
  6. Go and MongoDB connection won't work with panic log "no reachable server"
  7. WordPress Posts Pagination Not Working
  8. F# sprintf won't print in interactive console
  9. Spring Integration get FTP files recursively with outbound-gateway
  10. Jade mixins not getting working from external file
  11. Can not access defined exports from the webpack bundle?
  12. Completely new to Node.js - API Programming
  13. Formatting Compare-Object Ouput
  14. Add dynamically added textbox value from User Control to main form
  15. Create a ByteBuf in Netty 4.0
  16. Is it possible to do computation before super() in the constructor?
  17. Q-learning Updating Frequency
  18. Wrong reload order when using Gulp and browserSync
  19. I use hugo build static page. But don't have content
  20. How to change background color and set bar colors based on conditional formatting in VBA?
  21. Problem when comparing two numeric values in SAS
  22. Is ACE reactor timer managment thread safe?
  23. Why Express res.render dumps the render output (EJS template) in console?
  24. Define generic typescript sort function of a certain type
  25. Eclipse RCP: TableViewer setInput from another view
  26. Migrating data from RDBMS to Arango DB: Bulk upload
  27. How can I check the existence of a key/file on an Amazon S3 Bucket using AWS iOS SDK v2?
  28. Can exponentially long bitstrings be stored in (and retrieved from) qubits reliably?
  29. Django refuses to save the date shown on form
  30. Debug output mentions I should ask for Application Badge permission