2015-02-24 14:00:19 +00:00
|
|
|
#include "IRCPinger_Th.h"
|
|
|
|
#include "externData.h"
|
|
|
|
|
|
|
|
void IRCPinger_Th::doEmitChangeRedIRCData(QString str)
|
|
|
|
{
|
|
|
|
emit ircPTh->changeRedIRCData(str);
|
|
|
|
};
|
|
|
|
void IRCPinger_Th::doEmitRestartIRC()
|
|
|
|
{
|
|
|
|
emit ircPTh->RestartIRC();
|
|
|
|
};
|
|
|
|
|
|
|
|
void IRCPinger_Th::run()
|
|
|
|
{
|
|
|
|
while(iWantToConnect)
|
|
|
|
{
|
|
|
|
if(globalPinger >= 360) //6min timeout
|
|
|
|
{
|
2015-02-24 14:14:32 +00:00
|
|
|
|
2015-02-24 14:00:19 +00:00
|
|
|
ircPTh->doEmitChangeRedIRCData("-//- Ping timeout. Reconnecting... ");
|
2015-02-24 14:14:32 +00:00
|
|
|
|
2015-02-24 14:00:19 +00:00
|
|
|
|
|
|
|
ircPTh->doEmitRestartIRC();
|
|
|
|
globalPinger = 0;
|
|
|
|
msleep(10000);
|
|
|
|
};
|
|
|
|
++globalPinger;
|
|
|
|
msleep(1000);
|
|
|
|
};
|
2015-03-10 14:35:50 +00:00
|
|
|
};
|