mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
bugfix: start connection state
This commit is contained in:
@@ -30,15 +30,24 @@ void TCPClient::setConnect(ServerSettings *serverSettings,QThread *th)
|
||||
|
||||
|
||||
socket->connectToHost(serverSettings->Address,serverSettings->Port.toShort());
|
||||
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::slotReadyRead,Qt::DirectConnection);
|
||||
connect(socket,&QTcpSocket::disconnected,this,&TCPClient::setDisconnect);
|
||||
connect(socket,&QTcpSocket::connected,this,&TCPClient::slotConnectNotify);
|
||||
|
||||
connect(this,&TCPClient::sigRecognize,recognizeSystem,&RecognizeSystem::recognize,Qt::DirectConnection);
|
||||
connect(this,&TCPClient::sigSetSocket,sendSystem,&SendSystem::setSocket);
|
||||
|
||||
emit sigSetSocket(socket);
|
||||
emit sigSendDebugLog("Try connect...");
|
||||
|
||||
if (socket->waitForConnected(2000))
|
||||
{
|
||||
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::slotReadyRead,Qt::DirectConnection);
|
||||
connect(socket,&QTcpSocket::disconnected,this,&TCPClient::setDisconnect);
|
||||
//connect(socket,&QTcpSocket::connected,this,&TCPClient::slotConnectNotify);
|
||||
|
||||
connect(this,&TCPClient::sigRecognize,recognizeSystem,&RecognizeSystem::recognize,Qt::DirectConnection);
|
||||
connect(this,&TCPClient::sigSetSocket,sendSystem,&SendSystem::setSocket);
|
||||
|
||||
emit sigSetSocket(socket);
|
||||
slotConnectNotify();
|
||||
}
|
||||
else
|
||||
{
|
||||
emit sigServerDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user