March 1, 2010
Report

The ReadStream Utility Class

Abstract

1 Introduction This document describes the ReadStream utility class which is dened and implemented in readStream.h and readStream.cpp respectively. The system control software is implemented as a series of cooperating client and server ap- plications that all run concurrently on the control computer. The applications communicate with each other by passing text-based messages back and forth to one another over TCP connections. Messages are encoded using our data serialization protocol (DSP) (see design document DES-0002, Data Serialization Protocol for complete details). DSP format messages are variable in length and contain no length eld in them to allow the receiver to know beforehand how many bytes need to be read o* the wire before the complete DSP message has been received. Instead, receivers are expected to count opening and closing parentheses, declaring a message to be complete once the closing parenthesis corresponding to the message's initial opening parenthesis is encountered. This is a somewhat cumbersome task that needs to be carried out in a number of di*erent places in the code base. The ReadStream class exists to make this message recognition task easy and consistent across the entire code base.

Revised: September 30, 2014 | Published: March 1, 2010

Citation

Hubbard C.W. 2010. The ReadStream Utility Class Richland, WA: Pacific Northwest National Laboratory.