Repository navigation
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. |
* feat: start work on exposing Dealer.Connect() * feat: implement dealer.Connect() * feat: move running ping ticker and opening connection from NewAccesspoint() to Accesspoint.Connect() * feat: move dealer.Connect() out of session, let caller handle it * feat: move running accesspoint.pongAckTicker() to startReceiving() * debug: add ping-pong trace logging for dealer and accesspoint * feat: move running dealer.pingTicker() to dealer.startReceiving() and move initializing lastPong to startReceiving * fix: reset dealer.lastPong on reconnect, increase pong tardiness interval to pingInterval+timeout * fix: return immediately from Close() if connection not open * fix: only close conn on receive loop termination when not stopping, remove read lock around recvLoop read
* feat: start work on exposing Dealer.Connect() * feat: implement dealer.Connect() * feat: move running ping ticker and opening connection from NewAccesspoint() to Accesspoint.Connect() * feat: move dealer.Connect() out of session, let caller handle it * feat: move running accesspoint.pongAckTicker() to startReceiving() * debug: add ping-pong trace logging for dealer and accesspoint * feat: move running dealer.pingTicker() to dealer.startReceiving() and move initializing lastPong to startReceiving * fix: reset dealer.lastPong on reconnect, increase pong tardiness interval to pingInterval+timeout * fix: return immediately from Close() if connection not open * fix: only close conn on receive loop termination when not stopping, remove read lock around recvLoop read
fixes #68