_lastPingTime(0),
_pingCount(0),
+ _sendPings(false),
_requestedUserModes('-')
{
_autoReconnectTimer.setSingleShot(true);
emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
+ enablePingTimeout();
+
// TokenBucket to avoid sending too much at once
_messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay)
_burstSize = 5;
sendPerform();
- enablePingTimeout();
+ _sendPings = true;
if (networkConfig()->autoWhoEnabled()) {
_autoWhoCycleTimer.start();
else {
_lastPingTime = now;
_pingCount++;
- userInputHandler()->handlePing(BufferInfo(), QString());
+ // Don't send pings until the network is initialized
+ if(_sendPings)
+ userInputHandler()->handlePing(BufferInfo(), QString());
}
}
void CoreNetwork::disablePingTimeout()
{
_pingTimer.stop();
+ _sendPings = false;
resetPingTimeout();
}