mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-24 02:07:58 +00:00
set connection id on start
This commit is contained in:
@@ -7,9 +7,11 @@ namespace LiveGameFeed.Hubs
|
||||
{
|
||||
public override Task OnConnected()
|
||||
{
|
||||
return Clients.All.userConnected("New connection " + Context.ConnectionId);
|
||||
// Set connection id for just connected client only
|
||||
return Clients.Client(Context.ConnectionId).setConnectionId(Context.ConnectionId);
|
||||
}
|
||||
|
||||
// Server side methods called from client
|
||||
public Task Subscribe(int matchId)
|
||||
{
|
||||
return Groups.Add(Context.ConnectionId, matchId.ToString());
|
||||
|
||||
Reference in New Issue
Block a user