Added more detailed timeout for data transfer between ResInsight and Octave

p4#: 22148
This commit is contained in:
Magne Sjaastad
2013-08-12 11:38:09 +02:00
parent 494a5857dd
commit 8c128aeb6e
19 changed files with 55 additions and 82 deletions

View File

@@ -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;