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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get the first pending connection, and set it as the current Client to handle
|
||||
|
||||
QTcpSocket *newClient = m_tcpServer->nextPendingConnection();
|
||||
this->handleClientConnection(newClient);
|
||||
handlePendingIncomingConnectionRequests();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -236,11 +232,14 @@ void RiaSocketServer::readCommandFromOctave()
|
||||
{
|
||||
delete m_currentCommand;
|
||||
m_currentCommand = NULL;
|
||||
|
||||
handlePendingIncomingConnectionRequests();
|
||||
return;
|
||||
}
|
||||
}
|
||||
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()));
|
||||
terminateCurrentConnection();
|
||||
@ -268,12 +267,7 @@ void RiaSocketServer::slotCurrentClientDisconnected()
|
||||
|
||||
terminateCurrentConnection();
|
||||
|
||||
QTcpSocket *newClient = m_tcpServer->nextPendingConnection();
|
||||
|
||||
if (newClient)
|
||||
{
|
||||
this->handleClientConnection(newClient);
|
||||
}
|
||||
handlePendingIncomingConnectionRequests();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -312,6 +306,8 @@ void RiaSocketServer::slotReadyRead()
|
||||
{
|
||||
delete m_currentCommand;
|
||||
m_currentCommand = NULL;
|
||||
|
||||
handlePendingIncomingConnectionRequests();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -336,3 +332,17 @@ int RiaSocketServer::currentCaseId() const
|
||||
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 terminateCurrentConnection();
|
||||
void readCommandFromOctave();
|
||||
void handlePendingIncomingConnectionRequests();
|
||||
|
||||
private:
|
||||
QTcpServer* m_tcpServer;
|
||||
|
Loading…
Reference in New Issue
Block a user