summaryrefslogtreecommitdiff
path: root/sapsocket.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
committerJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
commita45977185a485624095bff1a15024e9199eee676 (patch)
tree6cc57d085bdd01e493477c870dbe0548137998e1 /sapsocket.h
parenta24034bdfea259cdc09c74217be75d4f9de0dce5 (diff)
downloadsapd-a45977185a485624095bff1a15024e9199eee676.tar.gz
sapd-a45977185a485624095bff1a15024e9199eee676.zip
reorganize source files into SAP and agents
Diffstat (limited to 'sapsocket.h')
-rw-r--r--sapsocket.h76
1 files changed, 0 insertions, 76 deletions
diff --git a/sapsocket.h b/sapsocket.h
deleted file mode 100644
index 59fcb3c..0000000
--- a/sapsocket.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef SAPSOCKET_H
-#define SAPSOCKET_H
-
-#include <QtCore/QObject>
-#include <QtCore/QQueue>
-#include <QtCore/QBasicTimer>
-
-#include "sapchannelinfo.h"
-
-class SAPConnection;
-class SAPPeer;
-
-class SAPSocket : public QObject
-{
- Q_OBJECT
-
- SAPSocket(SAPConnection *conn, int sessionId, const SAPChannelInfo &chanInfo);
-
-public:
- SAPPeer *peer();
- SAPConnection *connection();
-
- SAPChannelInfo channelInfo() const;
-
- 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);
- void acceptIncomingControl(const QByteArray &data);
-
- int sessionId() const;
-
- virtual void timerEvent(QTimerEvent *event) override;
-
-private:
- bool isReliable() const;
- bool supportsFragmentation() const;
-
- void sendBlockAck(int seqNum);
- void sendPacket(int seqNum, const QByteArray &data);
-
- void handleBlockAck(int seqNum);
- void sendPacketsFromQueue();
-
-private:
- const int _sessionId;
- const SAPChannelInfo _info;
- bool _open;
- QQueue<QByteArray> _in;
- QQueue<QByteArray> _out;
- QBasicTimer _ackTimer;
- QBasicTimer _resendTimer;
-
- /** Last acknowledged sent message. */
- quint16 _outLastAck;
- quint16 _outFlyingPkts;
-
- /** Next expected incoming sequence number */
- quint16 _inLastSeqNum;
- /** Last acknowledged sequence number */
- quint16 _inLastAck;
-
- friend class SAPPeer;
-};
-
-#endif // SAPSOCKET_H