Last active
October 10, 2017 16:34
-
-
Save DanielSSilva/33d7befb547c38ce7e0942ba58f219b9 to your computer and use it in GitHub Desktop.
SignalR sample
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
HubConnection connection = new HubConnectionBuilder() | |
.WithUrl("http://localhost:52846/entryPoint") | |
.WithConsoleLogger() | |
.Build(); | |
connection.StartAsync().GetAwaiter().GetResult(); | |
connection.InvokeAsync("RegisterConnectionOnGroup", "CoolEmployees"); | |
int myNumber = r.Next(0, 1000); // just to ensure that we have different clients | |
connection.On<string>("ClientMethod", data => Console.WriteLine($"I'm CoolEmployee with random number = {myNumber} - GOT THIS: {data}")); | |
while (true) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment