diff --git a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp index e6444f314d..2426f95252 100644 --- a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp @@ -132,20 +132,9 @@ public: quint64 timestepByteCount = (quint64)(timestepResultCount*sizeof(qint32)); socketStream << timestepByteCount; - // Then write the data. - for (size_t tIdx = 0; tIdx < columnCount; ++tIdx) - { -#if 1 // Write data as raw bytes, fast but does not handle byteswapping - RiaSocketTools::writeBlockData(server, server->currentClient(), (const char *)activeCellInfo[tIdx].data(), timestepByteCount); - -#else // Write data using QDataStream, does byteswapping for us. Must use QDataStream on client as well - for (size_t cIdx = 0; cIdx < activeCellInfo[tIdx].size(); ++cIdx) - { - socketStream << activeCellInfo[tIdx][cIdx]; - } -#endif - } + // Write data as raw bytes, fast but does not handle byteswapping + RiaSocketTools::writeBlockData(server, server->currentClient(), (const char *)activeCellInfo.data(), columnCount*timestepByteCount); return true; } diff --git a/OctavePlugin/riGetActiveCellInfo.cpp b/OctavePlugin/riGetActiveCellInfo.cpp index a7213a3697..8a9f4bc8eb 100644 --- a/OctavePlugin/riGetActiveCellInfo.cpp +++ b/OctavePlugin/riGetActiveCellInfo.cpp @@ -2,10 +2,8 @@ #include #include - #include "riSettings.h" -#include "riSocketTools.h" - +#include "RiaSocketDataTransfer.cpp" // NB! Include cpp-file to avoid linking of additional file in oct-compile configuration void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, quint16 port, const qint64& caseId, const QString& porosityModel) { @@ -67,7 +65,7 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu qint32* internalMatrixData = (qint32*)activeCellInfo.fortran_vec()->mex_get_data(); QStringList errorMessages; - if (!readBlockData(socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages)) + if (!RiaSocketDataTransfer::readBlockDataFromSocket(&socket, (char*)(internalMatrixData), columnCount * byteCountForOneTimestep, errorMessages)) { for (int i = 0; i < errorMessages.size(); i++) {