Last post Apr 25, 2017 10:28 AM by vinodkus
Apr 24, 2017 04:36 AM|vinodkus|LINK
I am working on chat application, I am able to do broadcast message to all client,
but I want to send message to any specific client. I can get all connected clients hub connection Id, but how can I identify which hub connection id is used for a particular client.
So I want to store any unique data created at server side code with hub connection id when client logins. But I am not able to store any unique key which is in session from Controller to hub class.
I am using MVC5. Please suggest me any solution for it.
Apr 25, 2017 08:02 AM|Cathy Zou|LINK
From your description, you want to get client connection id to call the special client instead of broadcast all clients.
As far as I know, You could use Context.ConnectionId in the Hub class scope, it means current client connection id.
More details, please refer the API guides:
Apr 25, 2017 10:28 AM|vinodkus|LINK
Thanks Cathy for your response.
Actually I find my solution with another way,
Actually I had to pass any specific user information like userid at the time of login and make a connection with hub connection id. So that If I call any friend with userid then
on the basis of userid I can get his hub connection id and can call him.
But I have one issue how to check that some message came at specific client and message window will automatically open there.