summaryrefslogtreecommitdiff
path: root/sapconnection.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-10-19 18:45:03 +0200
committerJavier <dev.git@javispedro.com>2014-10-19 18:45:03 +0200
commitd8d8fc7a0d139e7b864eee3b573bd208f823ad4f (patch)
treea9b54d6e6e6941c620f4f10cef4b5def9be86f82 /sapconnection.cc
downloadsapd-d8d8fc7a0d139e7b864eee3b573bd208f823ad4f.tar.gz
sapd-d8d8fc7a0d139e7b864eee3b573bd208f823ad4f.zip
initial import, no crypto
Diffstat (limited to 'sapconnection.cc')
-rw-r--r--sapconnection.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/sapconnection.cc b/sapconnection.cc
new file mode 100644
index 0000000..970ad11
--- /dev/null
+++ b/sapconnection.cc
@@ -0,0 +1,38 @@
+#include "sappeer.h"
+#include "sapconnection.h"
+
+SAPConnection::SAPConnection(SAPPeer *peer, const QString &profile)
+ : QObject(peer), _profile(profile)
+{
+}
+
+SAPPeer* SAPConnection::peer()
+{
+ return static_cast<SAPPeer*>(parent());
+}
+
+QString SAPConnection::profile() const
+{
+ return _profile;
+}
+
+SAPSocket * SAPConnection::getSocket(int channelId)
+{
+ return _sockets.value(channelId, 0);
+}
+
+QList<SAPSocket*> SAPConnection::sockets()
+{
+ return _sockets.values();
+}
+
+void SAPConnection::close()
+{
+ // TODO
+}
+
+void SAPConnection::setSocket(int channelId, SAPSocket *socket)
+{
+ Q_ASSERT(!_sockets.contains(channelId));
+ _sockets.insert(channelId, socket);
+}