I have built QMS from today's development source for to check if issue
#355 got resolved by current method of determining BRouter local server's ready-for-connect state. I encountered 3 different behaviours which make me believe that method is not yet reliable.
- Rarely - Message "connection denied" in QMS window still occurs
- Mostly - Message "connection denied" does not occur
- Sometimes - Message "connection denied" does not occur but terminal window shows warning message
[warning] QAbstractSocket::waitForDisconnected() is not allowed in UnconnectedState
Then I inserted following debug line of code after count loop ...
... and noticed following cases:
- Case 3 - connected=1 counts>0 - Connecting socket to BRouter process succeeded within 10 attempts, i.e 10*100 msec = 1 second
- Case 2 - connected=0 counts=0 - Connecting did not succeed within 10 attempts or 1 sec. Nevertheless 1 second delay was enough for BRouter process to become ready for accepting connection when starting new track.
- Case 1 - connected=0 counts=0 - Connecting did not succeed within 10 attempts or 1 sec. BRouter process was still not ready for accepting connection. Increasing attempt count to 50 i.e. 5 seconds did help.
To avoiding warning message in case 3, modifying following line of code helps:
- socket.waitForDisconnected(); + if (socket.state() != QAbstractSocket::UnconnectedState) socket.waitForDisconnected();