Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 21, 2013 12:11 PM by Ruchira
Feb 20, 2013 06:05 PM|LINK
Hi to all. I was looking for examples to find a solution for my problem. Basicall What I am trying to do is send notification or message to a specific client.
But I saw that I have no control on client connectionId. So How can I solve this kind of problem with SignalR or at least can u give one example about that. The example might be about chat client to client or send a notification to a specific user.
Thanx for all replies.
Feb 20, 2013 09:40 PM|LINK
one possible way to do this, is to add the client to a group which only has himself inside, then you broadcast to that group
e.g userid = user123
add user123 to the group user123 (same as userid)
then when you want to send a message to the user, send to the group user123
Feb 20, 2013 09:50 PM|LINK
So in this point a question pop in my mind which is performance issue.
If I follow a way like that. Would it be cause any performance problem or it is not relavent with the performance.
I hope I made my point clear.
Feb 20, 2013 09:53 PM|LINK
groups doesnt really matter, signalr keeps its own records for who is in which group, there may be some performance issue with the many duplicates but modern hardware should be more than sufficient.
as for active connections, this doesnt affect since its purely a record
that said, it depends on which version of signalr you are using (i'm basing it on 1.0) and you might want to confirm it with a load test of sorts
Feb 21, 2013 12:11 PM|LINK
Basicall What I am trying to do is send notification or message to a specific client.
You can do that. You can use Clients.Client() method for that. Pass the connection ID of specific client to the
But I saw that I have no control on client connectionId.
Why not? When each client opens the web application, you can maintain an
static ConcurrentDictionary to keep the IDs. Get the ID using the SignalR client library (using $.connection.hub.id). Then call a server method from $.connection.hub.start().done() method. In that server method,
add the client id in to the dictionary. $.connection.hub.start().done() will call whenever a user opens the application.
So How can I solve this kind of problem with SignalR or at least can u give one example about that. The example might be about chat client to client or send a notification to a specific user.
You can refer my blogpost below
Please 'Mark as Answer' if this post helps you.