Skip to content
Snippets Groups Projects
Commit dc6ba8c6 authored by Miller, Ross's avatar Miller, Ross
Browse files

Replace Linux-specific code with cross-platform code in ADARA files.

refs #5367
parent 4c7097f8
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
#include <string>
#include <stdint.h>
#include <time.h>
#include "MantidDataHandling/ADARA.h"
#include "MantidDataHandling/ADARAPackets.h"
......@@ -30,7 +29,8 @@ public:
* limits the amount of maximum amount of data read and parsed
* from the file descriptor.
*/
bool read(int fd, unsigned int max_read = 0);
// Commented out in favor of the Poco version below for Mantid use
// bool read(int fd, unsigned int max_read = 0);
// Similar semantics as above: returns true if a timeout is set on the
// socket and we hit the timeout before reading max_read bytes.
......
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include "MantidDataHandling/ADARAParser.h"
......@@ -30,6 +28,11 @@ void Parser::reset(void)
m_oversize_len = 0;
}
#if 0
// Mantid doesn't use this, and trying to make it build on
// Windows would be a nightmare...
#include <unistd.h>
#include <errno.h>
bool Parser::read(int fd, unsigned int max_read)
{
unsigned long bytes_read = 0;
......@@ -63,13 +66,13 @@ bool Parser::read(int fd, unsigned int max_read)
return true;
}
#endif
/* Added by RGM, 17 May 2012 */
bool Parser::read(Poco::Net::StreamSocket &stream, unsigned int max_read)
{
unsigned long bytes_read = 0;
ssize_t rc;
int rc;
while (!max_read || bytes_read < max_read) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment