/// <summary> /// Handles when a client gets disconnected. /// </summary> /// <param name="stopCalled">True, if stop was called on the client closing the connection gracefully; /// false, if the connection has been lost for longer than the timeout.</param> /// <returns></returns> public override Task OnDisconnectedAsync(Exception exception) { // Remove the controller on disconnection. _vmControllerFactory.Remove(Context.ConnectionId); // Allow middlewares to hook to the event. _hubPipeline.RunDisconnectionMiddlewares(Context); return(base.OnDisconnectedAsync(exception)); }
/// <summary> /// Handles when a client gets disconnected. /// </summary> /// <param name="stopCalled">True, if stop was called on the client closing the connection gracefully; /// false, if the connection has been lost for longer than the timeout.</param> /// <returns></returns> public override Task OnDisconnected(bool stopCalled) { // Access VMController to set the ambient context. var controller = VMController; // Remove the controller on disconnection. _vmControllerFactory.Remove(Context.ConnectionId); // Allow middlewares to hook to the event. _hubPipeline.RunDisconnectionMiddlewares(Context); return(base.OnDisconnected(stopCalled)); }
/// <summary> /// Handles when a client gets disconnected. /// </summary> /// <param name="stopCalled">True, if stop was called on the client closing the connection gracefully; /// false, if the connection has been lost for longer than the timeout.</param> /// <returns></returns> public override async Task OnDisconnectedAsync(Exception exception) { // Access VMController to set the ambient context. VMController _ = VMController; // Remove the controller on disconnection. _vmControllerFactory.Remove(Context.ConnectionId); // Allow middlewares to hook to the event. await _hubPipeline.RunDisconnectionMiddlewaresAsync(Context); await base.OnDisconnectedAsync(exception); }
/// <summary> /// Handles when a client gets disconnected. /// </summary> /// <param name="stopCalled">True, if stop was called on the client closing the connection gracefully; /// false, if the connection has been lost for longer than the timeout.</param> /// <returns></returns> public override Task OnDisconnected(bool stopCalled) { // Remove the controller on disconnection. _vmControllerFactory.Remove(Context.ConnectionId); return(base.OnDisconnected(stopCalled)); }