pstavirs / ostinato

Ostinato - Packet/Traffic Generator and Analyzer
https://ostinato.org
753 stars 137 forks source link

30 sec delay until GUI connects to drone #266

Open ghost opened 6 years ago

ghost commented 6 years ago

Ostinato master (9a4e7e7550c6b20a8f0f1393a55036492c1b7703) on OS X v10.11.6, QT 5.9.3

When starting the Ostinato GUI it takes 30 seconds to connect to the drone, when the drone is started by the GUI. During the waiting time I can create a new port group to the local drone, which connects immediately. ostinato

I don't have this issue with the official 0.9 version (based on QT4) and haven't experienced that on Linux.

The log shows, that the GUI creates a connection to the drone (in on_mpSocket_stateChanged the state changed to 2 - ConnectingState) before the drone starts to listen on port 7878. Then it takes 30 seconds until the connection state changes to 3 - ConnectedState. ostinato.log.txt

A simple workaround is to add a delay (QThread::msleep(500);) after starting the drone in client/mainwindow.cpp line 85, but I'm sure there are better solutions to delay the connection setup to the drone in case it's started by ostinato.

ghost commented 6 years ago

Here a Wireshark trace, the immediate connection from GUI to drone is refused, then it takes about 30 sec for a retry. wireshark_qt5

In contrast here the official 0.9 version with QT4. It also refuses the first connection, but the retry takes only 0.27 seconds. wireshark_qt4

pstavirs commented 4 years ago

I see this issue on v1.0 on Windows, although delay is around 5-10 seconds only. Not sure about Mac.

Likely cause is that the drone init takes more time now in v1.0 due to addition of the host devices feature.

Reopening this issue so that it can be tracked.