mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix for correct handling of pending socket connection requests
p4#: 21759
This commit is contained in:
parent
389247c17e
commit
1519ad0ad1
@ -129,11 +129,7 @@ void RiaSocketServer::slotNewClientConnection()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handlePendingIncomingConnectionRequests();
|
||||||
// Get the first pending connection, and set it as the current Client to handle
|
|
||||||
|
|
||||||
QTcpSocket *newClient = m_tcpServer->nextPendingConnection();
|
|
||||||
this->handleClientConnection(newClient);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -236,11 +232,14 @@ void RiaSocketServer::readCommandFromOctave()
|
|||||||
{
|
{
|
||||||
delete m_currentCommand;
|
delete m_currentCommand;
|
||||||
m_currentCommand = NULL;
|
m_currentCommand = NULL;
|
||||||
|
|
||||||
|
handlePendingIncomingConnectionRequests();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Todo: When all commands are into new shape, do the "unknown command" error output here.
|
handlePendingIncomingConnectionRequests();
|
||||||
|
|
||||||
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Unknown command: %1").arg(args[0].data()));
|
m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Unknown command: %1").arg(args[0].data()));
|
||||||
terminateCurrentConnection();
|
terminateCurrentConnection();
|
||||||
@ -268,12 +267,7 @@ void RiaSocketServer::slotCurrentClientDisconnected()
|
|||||||
|
|
||||||
terminateCurrentConnection();
|
terminateCurrentConnection();
|
||||||
|
|
||||||
QTcpSocket *newClient = m_tcpServer->nextPendingConnection();
|
handlePendingIncomingConnectionRequests();
|
||||||
|
|
||||||
if (newClient)
|
|
||||||
{
|
|
||||||
this->handleClientConnection(newClient);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -312,6 +306,8 @@ void RiaSocketServer::slotReadyRead()
|
|||||||
{
|
{
|
||||||
delete m_currentCommand;
|
delete m_currentCommand;
|
||||||
m_currentCommand = NULL;
|
m_currentCommand = NULL;
|
||||||
|
|
||||||
|
handlePendingIncomingConnectionRequests();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -336,3 +332,17 @@ int RiaSocketServer::currentCaseId() const
|
|||||||
return m_currentCaseId;
|
return m_currentCaseId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiaSocketServer::handlePendingIncomingConnectionRequests()
|
||||||
|
{
|
||||||
|
QTcpSocket* newClient = m_tcpServer->nextPendingConnection();
|
||||||
|
if (newClient)
|
||||||
|
{
|
||||||
|
terminateCurrentConnection();
|
||||||
|
|
||||||
|
this->handleClientConnection(newClient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ private:
|
|||||||
void handleClientConnection( QTcpSocket* clientToHandle);
|
void handleClientConnection( QTcpSocket* clientToHandle);
|
||||||
void terminateCurrentConnection();
|
void terminateCurrentConnection();
|
||||||
void readCommandFromOctave();
|
void readCommandFromOctave();
|
||||||
|
void handlePendingIncomingConnectionRequests();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTcpServer* m_tcpServer;
|
QTcpServer* m_tcpServer;
|
||||||
|
Loading…
Reference in New Issue
Block a user