5#include "errorstack.hh"
44 SlipStream(QIODevice *device, QObject *parent=
nullptr);
47 bool isOpen()
const override;
48 void close()
override;
57 static constexpr char END_OF_PACKET =
'\xC0';
58 static constexpr char ESCAPE =
'\xDB';
59 static constexpr char ESCAPED_C0 =
'\xDC';
60 static constexpr char ESCAPED_DB =
'\xDD';
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
PacketStream(QObject *parent=nullptr)
Hidden constructor.
Definition packetstream.cc:8
virtual void close()=0
Closes the stream.
virtual ~PacketStream()
Destructor.
Definition packetstream.cc:14
virtual bool isOpen() const =0
Returns true if the stream is open.
virtual bool send(const QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack())=0
Receives a datagram.
virtual bool receive(QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack())=0
Receives a datagram.
bool receive(QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack()) override
Receives a datagram.
Definition packetstream.cc:45
void close() override
Closes the stream.
Definition packetstream.cc:38
SlipStream(QIODevice *device, QObject *parent=nullptr)
Constructor, takes ownership of the device.
Definition packetstream.cc:23
bool send(const QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack()) override
Receives a datagram.
Definition packetstream.cc:85
bool isOpen() const override
Returns true if the stream is open.
Definition packetstream.cc:32