StateTimer = new QTimer(this);ControlSock = new QTcpSocket(this);StatSock = new QTcpSocket(this);
QObject::connect(StateTimer, SIGNAL(timeout()), this, SLOT(Timer_slot()));QObject::connect(ControlSock, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(ControlSockStateChange_slot(QAbstractSocket::SocketState)));QObject::connect(StatSock, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(StatSockStateChange_slot(QAbstractSocket::SocketState)));QObject::connect(ControlSock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(ControlSockError_slot(QAbstractSocket::SocketError)));QObject::connect(StatSock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(StatSockError_slot(QAbstractSocket::SocketError)));
counter++;qDebug() << "call: " << (int) QThread::currentThreadId();qDebug() << "counter: " <<counter;....counter--;return;