Created
June 2, 2012 19:39
-
-
Save yojimbo87/2859711 to your computer and use it in GitHub Desktop.
SignalR disconnect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Threading.Tasks; | |
using SignalR.Hosting; | |
using SignalR.Hubs; | |
namespace SignalrDisconnectIssue | |
{ | |
public class Chat : Hub, IDisconnect, IConnected | |
{ | |
public Task Disconnect() | |
{ | |
return Clients.addMessage(Context.ConnectionId + " disconnected"); | |
} | |
public Task Connect() | |
{ | |
return Clients.addMessage(Context.ConnectionId + " connected"); | |
} | |
public Task Reconnect(IEnumerable<string> groups) | |
{ | |
//return Clients.addMessage(Context.ConnectionId + " reconnected"); | |
return null; | |
} | |
public void Send(string message) | |
{ | |
// Call the addMessage method on all clients | |
Clients.addMessage(message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment