Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I'm creating a chat application in SignalR. Now I want to send a message to 1 user that is connected to the SignalR, but none of the other client may receive this message.

So I'm looking for something like this:
C#
public void AddMessage(int ProfileID, string Message)
{
    var context = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
    context.Clients(ProfileID).addMessage(Message);
}


I've already found the "solution" on this website:

http://stackoverflow.com/questions/8130132/storing-user-on-login-then-pushing-data-on-demand[^]

But this code is not valid anymore since SignalR changes every version.

Does anyone know how to solve this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900