Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending message to specific User #12427

Closed
garfbradaz opened this issue May 15, 2019 — with docs.microsoft.com · 2 comments

Comments

Projects
None yet
4 participants
Copy link

commented May 15, 2019 — with docs.microsoft.com

Hey guys, how to do you send a specific message to a user/client from a Controller outside the hub?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@serpent5

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

Take the example from the page:

await _hubContext.Clients.All.SendAsync("Notify", $"Home page loaded at: {DateTime.Now}");

To send to a specific user/client, use the relevant method:

await _hubContext.Clients.Client("clientId").SendAsync("Notify", $"Home page loaded at: {DateTime.Now}");
await _hubContext.Clients.User("userId").SendAsync("Notify", $"Home page loaded at: {DateTime.Now}");

@Rick-Anderson Rick-Anderson added this to the Backlog milestone May 18, 2019

@Rick-Anderson

This comment has been minimized.

Copy link
Contributor

commented May 18, 2019

Thanks for contacting us. We believe that the question you've raised have been answered. If you still feel a need to continue the discussion, feel free to reopen it and add your comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.