diff --git a/Core/tcpclient.cpp b/Core/tcpclient.cpp index b29b3ad..6b3561e 100644 --- a/Core/tcpclient.cpp +++ b/Core/tcpclient.cpp @@ -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(); + } } diff --git a/RRJClient.pro.user b/RRJClient.pro.user index c83cab1..0a5680e 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/StaticData/clientHash.xml b/StaticData/clientHash.xml index f532b08..a43e090 100644 --- a/StaticData/clientHash.xml +++ b/StaticData/clientHash.xml @@ -24,795 +24,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index e6c9a30..930e4f5 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/tcpclient.o b/debug/tcpclient.o index 2ad2b51..a91885e 100644 Binary files a/debug/tcpclient.o and b/debug/tcpclient.o differ