Last active
December 22, 2015 23:59
-
-
Save robertiagar/6550600 to your computer and use it in GitHub Desktop.
how to kill all your connected clients in signalr.
this is just stupid code that I'm sharing. not sure why am I even sharing it.
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
public class TaskConfig | |
{ | |
private static IHubContext _context = GlobalHost.ConnectionManager.GetHubContext<BroadcastHub>(); | |
public static void RegisterTasks() | |
{ | |
var t = new Task(() => | |
{ | |
while (true) | |
{ | |
_context.Clients.All.ranAt(string.Format("The Task ran at {0}", DateTime.Now)); | |
} | |
}); | |
t.Start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment