void Exchange::run() { if(debugLevel)logThread->writeLogB(baseValues.exchangeName+" API Thread Started",2); clearVariables(); secondTimer=new QTimer; secondTimer->setSingleShot(true); connect(secondTimer,SIGNAL(timeout()),this,SLOT(secondSlot())); secondSlot(); exec(); }
void SocketThread::run() { { queryTime.restart(); if(isLogEnabled)logThread->writeLog("SocketThread Started"); sslSocket=new QSslSocket; connect(this,SIGNAL(sendToApiSignal(QByteArray, QByteArray)),this,SLOT(sendToApiSlot(QByteArray, QByteArray))); connect(this,SIGNAL(reconnectApiSignal()),this,SLOT(reconnectApiSlot())); connect(sslSocket,SIGNAL(readyRead()),SLOT(readSocket())); secondTimer=new QTimer; connect(secondTimer,SIGNAL(timeout()),this,SLOT(secondSlot())); if(useSSL)sslSocket->connectToHostEncrypted(hostName, 443); else sslSocket->connectToHost(hostName, 80); sslSocket->waitForConnected(); if(isLogEnabled) { logThread->writeLog("SSL Socket state:"+sslSocket->errorString().toAscii()+". Supported: "+QByteArray::number(sslSocket->supportsSsl())); } secondTimer->start(100); sendPendingData(); } exec(); }