diff --git a/OctavePlugin/riGetActiveCellCenters.cpp b/OctavePlugin/riGetActiveCellCenters.cpp index 6ee9d3cdd3..2505a8bc00 100644 --- a/OctavePlugin/riGetActiveCellCenters.cpp +++ b/OctavePlugin/riGetActiveCellCenters.cpp @@ -9,12 +9,10 @@ void getActiveCellCenters(NDArray& cellCenterValues, const QString &hostName, qu QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getActiveCellCenters(NDArray& cellCenterValues, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2 * sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -65,7 +63,7 @@ void getActiveCellCenters(NDArray& cellCenterValues, const QString &hostName, qu while (socket.bytesAvailable() < (qint64)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetActiveCellCorners.cpp b/OctavePlugin/riGetActiveCellCorners.cpp index ce03ef953f..69f6ac136a 100644 --- a/OctavePlugin/riGetActiveCellCorners.cpp +++ b/OctavePlugin/riGetActiveCellCorners.cpp @@ -9,12 +9,10 @@ void getActiveCellCorners(NDArray& cellCornerValues, const QString &hostName, qu QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getActiveCellCorners(NDArray& cellCornerValues, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2 * sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -65,7 +63,7 @@ void getActiveCellCorners(NDArray& cellCornerValues, const QString &hostName, qu while (socket.bytesAvailable() < (qint64)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetActiveCellInfo.cpp b/OctavePlugin/riGetActiveCellInfo.cpp index f3b1601ed3..dbf278ef23 100644 --- a/OctavePlugin/riGetActiveCellInfo.cpp +++ b/OctavePlugin/riGetActiveCellInfo.cpp @@ -9,12 +9,10 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -69,7 +67,7 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu { while (socket.bytesAvailable() < (int)byteCount) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { QString errorMsg = QString("Waiting for column number: %1 of %2: %3").arg(tIdx).arg(columnCount).arg(socket.errorString()); diff --git a/OctavePlugin/riGetActiveCellProperty.cpp b/OctavePlugin/riGetActiveCellProperty.cpp index 0f14588d09..b23929121e 100644 --- a/OctavePlugin/riGetActiveCellProperty.cpp +++ b/OctavePlugin/riGetActiveCellProperty.cpp @@ -5,12 +5,10 @@ void getActiveCellProperty(Matrix& propertyFrames, const QString &serverName, quint16 serverPort, const qint64& caseId, QString propertyName, const int32NDArray& requestedTimeSteps, QString porosityModel) { - const int Timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(Timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -40,7 +38,7 @@ void getActiveCellProperty(Matrix& propertyFrames, const QString &serverName, qu while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -71,7 +69,7 @@ void getActiveCellProperty(Matrix& propertyFrames, const QString &serverName, qu { while (socket.bytesAvailable() < (int)byteCount) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for timestep data number: ") + QString::number(tIdx)+ ": " + socket.errorString()).toLatin1().data()); octave_stdout << "Active cells: " << activeCellCount << ", Timesteps: " << timestepCount << std::endl; diff --git a/OctavePlugin/riGetCaseGroups.cpp b/OctavePlugin/riGetCaseGroups.cpp index 88c6b9d0a9..18578f3f9d 100644 --- a/OctavePlugin/riGetCaseGroups.cpp +++ b/OctavePlugin/riGetCaseGroups.cpp @@ -9,12 +9,10 @@ void getCaseGroups(std::vector& groupNames, std::vector& groupIds, QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -33,7 +31,7 @@ void getCaseGroups(std::vector& groupNames, std::vector& groupIds, // Get response. First wait for the header while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; @@ -51,7 +49,7 @@ void getCaseGroups(std::vector& groupNames, std::vector& groupIds, // Get response. Read all data for command while (socket.bytesAvailable() < (int)byteCount) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCases.cpp b/OctavePlugin/riGetCases.cpp index ef7a486f68..1cb3dda737 100644 --- a/OctavePlugin/riGetCases.cpp +++ b/OctavePlugin/riGetCases.cpp @@ -9,12 +9,10 @@ void getCases(std::vector& caseIds, std::vector& caseNames, std QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getCases(std::vector& caseIds, std::vector& caseNames, std while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -47,7 +45,7 @@ void getCases(std::vector& caseIds, std::vector& caseNames, std while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCellCenters.cpp b/OctavePlugin/riGetCellCenters.cpp index 9672d75533..371021fedd 100644 --- a/OctavePlugin/riGetCellCenters.cpp +++ b/OctavePlugin/riGetCellCenters.cpp @@ -9,12 +9,10 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16 QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (int)(5 * sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -70,7 +68,7 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (qint64)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCellCorners.cpp b/OctavePlugin/riGetCellCorners.cpp index 3b462e1d18..ba24454bbe 100644 --- a/OctavePlugin/riGetCellCorners.cpp +++ b/OctavePlugin/riGetCellCorners.cpp @@ -9,12 +9,10 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16 QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (int)(5 * sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -72,7 +70,7 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (qint64)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCoarseningInfo.cpp b/OctavePlugin/riGetCoarseningInfo.cpp index f7836c1973..7d4e4a3a92 100644 --- a/OctavePlugin/riGetCoarseningInfo.cpp +++ b/OctavePlugin/riGetCoarseningInfo.cpp @@ -9,12 +9,10 @@ void getCoarseningInfo(int32NDArray& coarseningInfo, const QString &hostName, qu 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; @@ -35,7 +33,7 @@ void getCoarseningInfo(int32NDArray& coarseningInfo, const QString &hostName, qu while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCurrentCase.cpp b/OctavePlugin/riGetCurrentCase.cpp index c08a7477db..395d85d56d 100644 --- a/OctavePlugin/riGetCurrentCase.cpp +++ b/OctavePlugin/riGetCurrentCase.cpp @@ -9,12 +9,10 @@ void getCurrentCase(qint64& caseId, QString& caseName, QString& caseType, qint64 QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getCurrentCase(qint64& caseId, QString& caseName, QString& caseType, qint64 while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -47,7 +45,7 @@ void getCurrentCase(qint64& caseId, QString& caseName, QString& caseType, qint64 while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetGridDimensions.cpp b/OctavePlugin/riGetGridDimensions.cpp index fa89cdbbe7..c42d007fb1 100644 --- a/OctavePlugin/riGetGridDimensions.cpp +++ b/OctavePlugin/riGetGridDimensions.cpp @@ -9,12 +9,10 @@ void getGridDimensions(int32NDArray& gridDimensions, const QString &hostName, qu 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; @@ -35,7 +33,7 @@ void getGridDimensions(int32NDArray& gridDimensions, const QString &hostName, qu while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetGridProperty.cpp b/OctavePlugin/riGetGridProperty.cpp index 3c0cca3468..5e1bcf7d09 100644 --- a/OctavePlugin/riGetGridProperty.cpp +++ b/OctavePlugin/riGetGridProperty.cpp @@ -5,12 +5,12 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 serverPort, const int& caseId, int gridIdx, QString propertyName, const int32NDArray& requestedTimeSteps, QString porosityModel) { - const int Timeout = riOctavePlugin::timeOutMilliSecs; + const int Timeout = riOctavePlugin::shortTimeOutMilliSecs; QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(Timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -40,7 +40,7 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 while (socket.bytesAvailable() < (int)(4*sizeof(quint64))) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -81,7 +81,7 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 while (socket.bytesAvailable() < (int)totalByteCount) { - if (!socket.waitForReadyRead(Timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error(("Waiting for data : " + socket.errorString()).toLatin1().data()); return ; diff --git a/OctavePlugin/riGetMainGridDimensions.cpp b/OctavePlugin/riGetMainGridDimensions.cpp index dc4d29b576..538173af5a 100644 --- a/OctavePlugin/riGetMainGridDimensions.cpp +++ b/OctavePlugin/riGetMainGridDimensions.cpp @@ -1,18 +1,17 @@ #include #include +#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; diff --git a/OctavePlugin/riGetSelectedCases.cpp b/OctavePlugin/riGetSelectedCases.cpp index ca7aaaa81f..c99cd8957b 100644 --- a/OctavePlugin/riGetSelectedCases.cpp +++ b/OctavePlugin/riGetSelectedCases.cpp @@ -9,12 +9,10 @@ void getSelectedCases(std::vector& caseIds, std::vector& caseNa QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +33,7 @@ void getSelectedCases(std::vector& caseIds, std::vector& caseNa while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -47,7 +45,7 @@ void getSelectedCases(std::vector& caseIds, std::vector& caseNa while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetTimeStepDates.cpp b/OctavePlugin/riGetTimeStepDates.cpp index 74fb5f8aec..b4d04ceb82 100644 --- a/OctavePlugin/riGetTimeStepDates.cpp +++ b/OctavePlugin/riGetTimeStepDates.cpp @@ -17,12 +17,10 @@ void getTimeStepDates( std::vector& yearValues, QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -43,7 +41,7 @@ void getTimeStepDates( std::vector& yearValues, while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -55,7 +53,7 @@ void getTimeStepDates( std::vector& yearValues, while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetTimeStepDays.cpp b/OctavePlugin/riGetTimeStepDays.cpp index e62b659516..b13ee43e9d 100644 --- a/OctavePlugin/riGetTimeStepDays.cpp +++ b/OctavePlugin/riGetTimeStepDays.cpp @@ -11,12 +11,10 @@ void getTimeStepDates( std::vector& decimalDays, QString serverName = hostName; quint16 serverPort = port; - const int timeout = riOctavePlugin::timeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(timeout)) + if (!socket.waitForConnected(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -37,7 +35,7 @@ void getTimeStepDates( std::vector& decimalDays, while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -49,7 +47,7 @@ void getTimeStepDates( std::vector& decimalDays, while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(timeout)) + if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riSetActiveCellProperty.cpp b/OctavePlugin/riSetActiveCellProperty.cpp index 12d191a82d..1c60484bba 100644 --- a/OctavePlugin/riSetActiveCellProperty.cpp +++ b/OctavePlugin/riSetActiveCellProperty.cpp @@ -9,7 +9,7 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q QTcpSocket socket; socket.connectToHost(hostName, port); - if (!socket.waitForConnected(riOctavePlugin::timeOutMilliSecs)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -47,7 +47,7 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q socketStream << (qint64)timeStepByteCount; const double* internalData = propertyFrames.fortran_vec(); - int dataWritten = socket.write((const char *)internalData, timeStepByteCount*timeStepCount); + qint64 dataWritten = socket.write((const char *)internalData, timeStepByteCount*timeStepCount); if (dataWritten == timeStepByteCount*timeStepCount) { @@ -72,7 +72,7 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q while(socket.bytesToWrite() && socket.state() == QAbstractSocket::ConnectedState) { // octave_stdout << "Bytes to write: " << socket.bytesToWrite() << std::endl; - socket.waitForBytesWritten(riOctavePlugin::timeOutMilliSecs); + socket.waitForBytesWritten(riOctavePlugin::longTimeOutMilliSecs); OCTAVE_QUIT; } diff --git a/OctavePlugin/riSetGridProperty.cpp b/OctavePlugin/riSetGridProperty.cpp index 6ad7c6c18f..0fd8174b04 100644 --- a/OctavePlugin/riSetGridProperty.cpp +++ b/OctavePlugin/riSetGridProperty.cpp @@ -9,7 +9,7 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName, QTcpSocket socket; socket.connectToHost(hostName, port); - if (!socket.waitForConnected(riOctavePlugin::timeOutMilliSecs)) + if (!socket.waitForConnected(riOctavePlugin::shortTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -93,7 +93,7 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName, while(socket.bytesToWrite() && socket.state() == QAbstractSocket::ConnectedState) { // octave_stdout << "Bytes to write: " << socket.bytesToWrite() << std::endl; - socket.waitForBytesWritten(riOctavePlugin::timeOutMilliSecs); + socket.waitForBytesWritten(riOctavePlugin::longTimeOutMilliSecs); OCTAVE_QUIT; } diff --git a/OctavePlugin/riSettings.h b/OctavePlugin/riSettings.h index 316751d667..77fdfc435a 100644 --- a/OctavePlugin/riSettings.h +++ b/OctavePlugin/riSettings.h @@ -20,7 +20,9 @@ namespace riOctavePlugin { - const int timeOutMilliSecs = 5000; + const int connectTimeOutMilliSecs = 5000; + const int shortTimeOutMilliSecs = 5000; + const int longTimeOutMilliSecs = 6 * shortTimeOutMilliSecs; // Octave data structure : CaseInfo char caseInfo_CaseId[] = "CaseId";