From a45977185a485624095bff1a15024e9199eee676 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 1 Jan 2016 22:05:42 +0100 Subject: reorganize source files into SAP and agents --- sapsocket.h | 76 ------------------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 sapsocket.h (limited to 'sapsocket.h') 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 -#include -#include - -#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 _in; - QQueue _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 -- cgit v1.2.3