When running locally through VS - IIS Express it all works fine 100%.
When i then publish to a webserver (on network or online) I have some event stop firing for \"O
Not a satisfying fix but adding a thread sleep before ResetTimer() seems to have fixed it.
Groups.Add(Context.ConnectionId, @group.Name);
Clients.OthersInGroup(@group.Name).addMessage(HttpUtility.HtmlEncode(user.Name + " has connected."));
Clients.Caller.addMessage(HttpUtility.HtmlEncode("You've connected..."));
Thread.Sleep(TimeSpan.FromSeconds(1)); //<<<<<<<<<
ResetTimer(@group.Name);
Even even better fix, issue is Groups.Add is ASYNCHRONOUS!! awaiting it solves the issue also. (dont forget to make OnConnected async too)
public async override Task OnConnected()
{
--->> await Groups.Add(Context.ConnectionId, "TestGroup");
Clients.Group("TestGroup").showBoxOne();
Clients.Group("TestGroup").showBoxTwo();
Clients.Group("TestGroup").showBoxThree();
Clients.Group("TestGroup").showBoxFour();
Clients.Group("TestGroup").showBoxFive();
}
await base.OnConnected();
}