Skip to content

Instantly share code, notes, and snippets.

@ngohungphuc
Created May 1, 2019 13:34
Show Gist options
  • Select an option

  • Save ngohungphuc/cbe4ab6805d7fcb7499e45cbcced923c to your computer and use it in GitHub Desktop.

Select an option

Save ngohungphuc/cbe4ab6805d7fcb7499e45cbcced923c to your computer and use it in GitHub Desktop.
public class ConnectionHub : Hub
{
public async Task Send(string userId)
{
var message = $"Send message to you with user id {userId}";
await Clients.Client(userId).SendAsync("ReceiveMessage", message);
}
public string GetConnectionId()
{
return Context.ConnectionId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment