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

@@ -11,12 +11,10 @@ void getTimeStepDates( std::vector<double>& 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<double>& 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<double>& decimalDays,
while (socket.bytesAvailable() < (int)(byteCount))
{
if (!socket.waitForReadyRead(timeout))
if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs))
{
error((("Waiting for data: ") + socket.errorString()).toLatin1().data());
return;