-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible race condition in playCtrl #48
Comments
Maybe instead of creating a new instance of StrongSocket for each game we should keep a global one and pass it to each game controller. |
But sockets are created for a URL that contains the game ID? |
We could add the What do you think? Also playCtrl should be removed completely as there's nothing left here... all should be done in round |
I don't think you can reuse a socket connection for distinct games. A round socket is bound to one game, defined by the round socket URL. |
nevermind, there's a confusion between instances of StrongSocket and actual browser WS connection. |
Yes reset could have an URL aargument additionally to version, to allow reuse of the StrongSocket instance while changing the underlying connection |
Yep that's what I meant. I think this is a fair approach to the problem mentioned above. And maybe it'll solve other issues... |
this.round
andthis.gameSocket
are initialised atnull
and an asynchronous xhr populates them. But the view depends on those objects.They should be created before and be
playCtrl
parameters to avoid problems.It doesn't respect the "model must always be valid" principle.
The text was updated successfully, but these errors were encountered: