diff --git a/Core/tcpclient.cpp b/Core/tcpclient.cpp index 5fcded6..06f8eff 100644 --- a/Core/tcpclient.cpp +++ b/Core/tcpclient.cpp @@ -22,9 +22,9 @@ void TCPClient::SetConnect(ServerSettings *serverSettings) { socket = new QTcpSocket(this); - connect(socket,&QTcpSocket::readyRead,this,&TCPClient::onReadyRead); + connect(socket,&QTcpSocket::readyRead,this,&TCPClient::onReadyRead,Qt::DirectConnection); connect(socket,&QTcpSocket::disconnected,this,&TCPClient::SetDisconnect); - connect(this,&TCPClient::Recognize,recognizeSystem,&RecognizeSystem::Recognize); + connect(this,&TCPClient::Recognize,recognizeSystem,&RecognizeSystem::Recognize,Qt::DirectConnection); socket->connectToHost(serverSettings->Address,serverSettings->Port.toShort()); emit onSendDebugLog("Try connect..."); diff --git a/RRJClient.pro.user b/RRJClient.pro.user index 29d05c8..3903a86 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index fe18d13..b4b4e9d 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 8cb1619..910768f 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/tcpclient.o b/debug/tcpclient.o index 1be312b..23d9818 100644 Binary files a/debug/tcpclient.o and b/debug/tcpclient.o differ diff --git a/mainwindow.cpp b/mainwindow.cpp index 5c6b407..3785258 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -22,9 +22,8 @@ void MainWindow::Initialize() ui->startButton->setEnabled(false); updateControllerThread = new QThread; - updateControllerThread->setPriority(QThread::LowPriority); connectionThread = new QThread; - connectionThread->setPriority(QThread::HighestPriority); + client = new TCPClient; client->moveToThread(connectionThread); @@ -44,17 +43,20 @@ void MainWindow::Initialize() connect(recognizeSystem,&RecognizeSystem::onSendDebugLog,this,&MainWindow::DebugLog); connect(recognizeSystem,&RecognizeSystem::SockedDisabled,this,&MainWindow::LostConnection); connect(recognizeSystem,&RecognizeSystem::SaveLoginData,this,&MainWindow::CheckLoginResult); - connect(recognizeSystem,&RecognizeSystem::SocketWaitForReadyRead,client,&TCPClient::WaitRead); + connect(recognizeSystem,&RecognizeSystem::SocketWaitForReadyRead,client,&TCPClient::WaitRead,Qt::AutoConnection); connectionThread->start(); updateControllerThread->start(); - connect(client,&TCPClient::onSendDebugLog,this,&MainWindow::DebugLog); + updateControllerThread->setPriority(QThread::LowPriority); + connectionThread->setPriority(QThread::HighestPriority); - connect(this,&MainWindow::onInitializeClient,client,&TCPClient::Initialize); - connect(this,&MainWindow::onSetConnect,client,&TCPClient::SetConnect); - connect(this,&MainWindow::onSendMessage,client,&TCPClient::MessageEntered); - connect(this,&MainWindow::SendClientAuthorization,client,&TCPClient::SendClientAutorization); + connect(client,&TCPClient::onSendDebugLog,this,&MainWindow::DebugLog,Qt::AutoConnection); + + connect(this,&MainWindow::onInitializeClient,client,&TCPClient::Initialize,Qt::AutoConnection); + connect(this,&MainWindow::onSetConnect,client,&TCPClient::SetConnect,Qt::AutoConnection); //умирает + connect(this,&MainWindow::onSendMessage,client,&TCPClient::MessageEntered,Qt::AutoConnection); + connect(this,&MainWindow::SendClientAuthorization,client,&TCPClient::SendClientAutorization,Qt::AutoConnection); connect(this,&MainWindow::onCalculateHash,updateController,&UpdateController::CalculateHash);