You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to surface the Details about the connection of the current client in order to get the current client Connection Id
For instance in a scenario where you have send a notification back to only the calling client for particular User.
You could do something like HubContext.CurrentClient.Send("MethodName", data )
OR HubContext.Client(HubContext.CurrentConnectionId).Send("MethodName", data )
The text was updated successfully, but these errors were encountered:
I dont believe this is possible. The HubContext its quite fairly simple class, and in the grain context you would not be are of the connectionId, unless you have it in your id; somehow you need to know who you intend to send to
Not 100% sure why would you need this, perhaps you can add more on it.
Generally how we use it in our application is:
If user is authenticated and we need to send to specific user (on all tabs/devices) we use User: _hubContext.User("123")
if we need to send to on a topic based on something we use Group e.g. _hubContext.Group($"hero:all")
If the above dont suffice, and you literally need to send only 1 message to the specific connectionId I suggest
On OnConnect (hub)
Get grain either pass the ConnectionId as part of the id or have a method .SetConnectionId (i suggest the as id, but might be difficult then to obtain the grain unless you will have connectionId)
Hello there,
Would it be possible to surface the Details about the connection of the current client in order to get the current client Connection Id
For instance in a scenario where you have send a notification back to only the calling client for particular User.
You could do something like
HubContext.CurrentClient.Send("MethodName", data )
OR
HubContext.Client(HubContext.CurrentConnectionId).Send("MethodName", data )
The text was updated successfully, but these errors were encountered: