KrisLibrary
1.0.0
|
A transport protocol that uses STL streams. More...
#include <AsyncIO.h>
Public Types | |
enum | Format { IntLengthPrepended, NullTerminated, Ascii, Base64 } |
Public Member Functions | |
StreamTransport (std::istream &in) | |
StreamTransport (std::ostream &out) | |
StreamTransport (std::istream &in, std::ostream &out) | |
virtual bool | ReadReady () |
Subclasses – can the object read? | |
virtual bool | WriteReady () |
Subclasses – can the object write? | |
virtual const std::string * | DoRead () |
virtual bool | DoWrite (const char *msg, int length) |
Public Member Functions inherited from TransportBase | |
virtual bool | Start () |
Subclasses – can the object read? | |
virtual bool | Stop () |
virtual bool | DoWrite (const char *msg) |
virtual bool | DoWrite (const std::string &msg) |
Public Attributes | |
std::istream * | in |
std::ostream * | out |
Format | format |
std::string | buffer |
A transport protocol that uses STL streams.
Stream format is controlled by the format member. By default uses IntLengthPrepended.
|
virtual |
Subclasses – in thread, do some I/O and processing (which may block), return the payload message. If NULL is returned, there is some error and the thread quits
Reimplemented from TransportBase.
References SafeInputString().
|
virtual |
Subclasses – in thread, do some I/O and processing (which may block) If false is returned, there is some error and the caller should quit or reopen the connection.
Reimplemented from TransportBase.
References SafeOutputString().