From d8d8fc7a0d139e7b864eee3b573bd208f823ad4f Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 19 Oct 2014 18:45:03 +0200 Subject: initial import, no crypto --- sapsocket.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sapsocket.h (limited to 'sapsocket.h') diff --git a/sapsocket.h b/sapsocket.h new file mode 100644 index 0000000..e1a9214 --- /dev/null +++ b/sapsocket.h @@ -0,0 +1,45 @@ +#ifndef SAPSOCKET_H +#define SAPSOCKET_H + +#include +#include + +class SAPConnection; +class SAPPeer; + +class SAPSocket : public QObject +{ + Q_OBJECT + + SAPSocket(SAPConnection *conn, int sessionId); + +public: + SAPPeer *peer(); + SAPConnection *connection(); + + bool isOpen() const; + + bool messageAvailable() const; + QByteArray receive(); + bool send(const QByteArray &data); + +signals: + void connected(); + void disconnected(); + void messageReceived(); + +protected: + void setOpen(bool open); + void acceptIncomingData(const QByteArray &data); + + int sessionId() const; + +private: + int _sessionId; + bool _open; + QQueue _in; + + friend class SAPPeer; +}; + +#endif // SAPSOCKET_H -- cgit v1.2.3