set connection id on start

This commit is contained in:
chsakell
2016-10-05 12:54:45 +03:00
parent 8a8055d0ba
commit 69afcd0108
9 changed files with 35 additions and 15 deletions

View File

@@ -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());