-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: delegate starting receiver loops to caller #69
Conversation
The reason why the receiver isn't started is that there might be messages that arrive immediately after connection and if there's no listener then they'll be lost. You'll need to call |
Maybe we could start the ping loop on the first |
That makes sense, but I believe that the server will close the connection if we don't ping it.
This makes even more sense, but we must be careful to the fact that the connection will be nil. Because connection can fail, I don't think delegating it to the All of the above also applies to the |
I'm going to reopen this when I've implemented the proper fix |
…oint() to Accesspoint.Connect()
I'm unsure whether to move |
It seems like the dealer ping timings are a bit too tight, it sends a ping every 30s, but also has a timeout of 30s, which can cause some network latency related reconnects, but that's only a guess, because it only happens on the 5th ping (after 150s) and I'm still looking into it |
… move initializing lastPong to startReceiving
…rval to pingInterval+timeout
Seems to be fixed by setting the time that the pong can be behind to |
I see, I guess this is ok because the accesspoint is required to complete authentication so it has to be always started.
Sure, this makes sense. |
…emove read lock around recvLoop read
Thanks! |
Had to implement a couple of fixes, looks better now. |
fixes #68