_lastPingTime(0),
_pingCount(0),
+ _sendPings(false),
_requestedUserModes('-')
{
_autoReconnectTimer.setSingleShot(true);
- _socketCloseTimer.setSingleShot(true);
connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout()));
setPingInterval(networkConfig()->pingInterval());
socket.setProxy(QNetworkProxy::NoProxy);
}
+ enablePingTimeout();
+
#ifdef HAVE_SSL
socket.setProtocol((QSsl::SslProtocol)server.sslVersion);
if (server.useSsl) {
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();
}