mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
ref: UI
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
TCPClient::TCPClient(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
socket = NULL;
|
||||
}
|
||||
|
||||
void TCPClient::Initialize(RecognizeSystem *recognize,ExternalExecuter *externalExecuter)
|
||||
@@ -20,6 +20,12 @@ void TCPClient::Initialize(RecognizeSystem *recognize,ExternalExecuter *external
|
||||
|
||||
void TCPClient::SetConnect(ServerSettings *serverSettings)
|
||||
{
|
||||
if (socket != NULL && socket->state() == QTcpSocket::ConnectedState)
|
||||
{
|
||||
emit onSendDebugLog("already connected");
|
||||
return;
|
||||
}
|
||||
|
||||
socket = new QTcpSocket(this);
|
||||
|
||||
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::onReadyRead,Qt::DirectConnection);
|
||||
@@ -91,6 +97,14 @@ void TCPClient::SendFile()
|
||||
countSend = 0;
|
||||
}
|
||||
|
||||
void TCPClient::SendUnityConnect()
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::TYPE_CHANGEPACKAGERESPONSE;
|
||||
socket->waitForBytesWritten();
|
||||
}
|
||||
|
||||
void TCPClient::SetDisconnect()
|
||||
{
|
||||
socket->disconnect();
|
||||
|
||||
Reference in New Issue
Block a user