diff options
author | Javier <dev.git@javispedro.com> | 2016-01-01 22:05:42 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2016-01-01 22:05:42 +0100 |
commit | a45977185a485624095bff1a15024e9199eee676 (patch) | |
tree | 6cc57d085bdd01e493477c870dbe0548137998e1 /sap/sapconnectionrequest.cc | |
parent | a24034bdfea259cdc09c74217be75d4f9de0dce5 (diff) | |
download | sapd-a45977185a485624095bff1a15024e9199eee676.tar.gz sapd-a45977185a485624095bff1a15024e9199eee676.zip |
reorganize source files into SAP and agents
Diffstat (limited to 'sap/sapconnectionrequest.cc')
-rw-r--r-- | sap/sapconnectionrequest.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sap/sapconnectionrequest.cc b/sap/sapconnectionrequest.cc new file mode 100644 index 0000000..4842ff6 --- /dev/null +++ b/sap/sapconnectionrequest.cc @@ -0,0 +1,40 @@ +#include "sappeer.h" +#include "sapconnection.h" +#include "sapconnectionrequest.h" + +SAPConnectionRequest::SAPConnectionRequest(SAPConnection *conn, int initiatorId, int acceptorId) + : _conn(conn), _initiator(initiatorId), _acceptor(acceptorId) +{ +} + +SAPConnection *SAPConnectionRequest::connection() +{ + return _conn; +} + +SAPPeer * SAPConnectionRequest::peer() +{ + return connection()->peer(); +} + +void SAPConnectionRequest::accept() +{ + peer()->acceptServiceConnection(this, 0); + delete this; +} + +void SAPConnectionRequest::reject(int reason) +{ + peer()->acceptServiceConnection(this, reason); + delete this; +} + +int SAPConnectionRequest::initiatorId() const +{ + return _initiator; +} + +int SAPConnectionRequest::acceptorId() const +{ + return _acceptor; +} |