Skip to content
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

call websocketDidConnect delegate after connected is set to prevent race condition #144

Merged
merged 1 commit into from
Dec 23, 2015

Conversation

JamesPrudente
Copy link
Contributor

Attempting to write to the socket during websocketDidConnect fails silently sometimes because connected is not set until after processHTTP returns. The isConnected guard in dequeueWrite can execute before connected is set to true.

This change ensures that connected is set before calling the delegate.

@daltoniam
Copy link
Owner

I think this will fix #147, correct?

@JamesPrudente
Copy link
Contributor Author

my PR is similar, but does not address the case in #147. My PR is about websocketDidConnect being called after connected is set. looks like the solution to #147 might be similar, but there are a bunch more cases where doDisconnect is called, so looks more complicated.

@daltoniam
Copy link
Owner

Ok cool. Thanks!

daltoniam added a commit that referenced this pull request Dec 23, 2015
call websocketDidConnect delegate after connected is set to prevent race condition
@daltoniam daltoniam merged commit d32dcb2 into daltoniam:master Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants