mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added more detailed timeout for data transfer between ResInsight and Octave
p4#: 22148
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
#include <QtNetwork>
|
||||
#include <octave/oct.h>
|
||||
|
||||
#include "riSettings.h"
|
||||
|
||||
void getMainGridDimensions(int32NDArray& gridDimensions, const QString &hostName, quint16 port, QString caseName)
|
||||
{
|
||||
QString serverName = hostName;
|
||||
quint16 serverPort = port;
|
||||
|
||||
const int Timeout = 5 * 1000;
|
||||
|
||||
QTcpSocket socket;
|
||||
socket.connectToHost(serverName, serverPort);
|
||||
|
||||
if (!socket.waitForConnected(Timeout))
|
||||
if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs))
|
||||
{
|
||||
error((("Connection: ") + socket.errorString()).toLatin1().data());
|
||||
return;
|
||||
@@ -34,7 +33,7 @@ void getMainGridDimensions(int32NDArray& gridDimensions, const QString &hostName
|
||||
|
||||
while (socket.bytesAvailable() < (int)(3*sizeof(quint64)))
|
||||
{
|
||||
if (!socket.waitForReadyRead(Timeout))
|
||||
if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs))
|
||||
{
|
||||
error((("Waiting for header: ") + socket.errorString()).toLatin1().data());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user