summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-19 13:48:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-19 13:48:19 (GMT)
commit958fe81b045e54ed6dadfe1fa9b14ac317811abf (patch)
tree4d341a6780bafb187d8aa753de71582f68949da0 /Swiften/Server/ServerFromClientSession.h
parenta6fcd9e7aa12c5e00c61ff809e81fba14babd70c (diff)
downloadswift-958fe81b045e54ed6dadfe1fa9b14ac317811abf.zip
swift-958fe81b045e54ed6dadfe1fa9b14ac317811abf.tar.bz2
Factor out common code from ServerFromClientSession.
Diffstat (limited to 'Swiften/Server/ServerFromClientSession.h')
-rw-r--r--Swiften/Server/ServerFromClientSession.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index 733c428..213f5c7 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -5,6 +5,7 @@
#include <boost/enable_shared_from_this.hpp>
#include "Swiften/Base/String.h"
+#include "Swiften/Session/Session.h"
#include "Swiften/JID/JID.h"
#include "Swiften/Network/Connection.h"
@@ -21,7 +22,7 @@ namespace Swift {
class Connection;
class ByteArray;
- class ServerFromClientSession : public boost::enable_shared_from_this<ServerFromClientSession> {
+ class ServerFromClientSession : public Session {
public:
ServerFromClientSession(
const String& id,
@@ -29,11 +30,6 @@ namespace Swift {
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
UserRegistry* userRegistry);
- ~ServerFromClientSession();
-
- void start();
-
- void sendStanza(boost::shared_ptr<Stanza>);
const JID& getJID() const {
return jid_;
@@ -43,28 +39,14 @@ namespace Swift {
return domain_;
}
- boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived;
- boost::signal<void ()> onSessionFinished;
- boost::signal<void ()> onSessionStarted;
- boost::signal<void (const ByteArray&)> onDataWritten;
- boost::signal<void (const ByteArray&)> onDataRead;
-
private:
- void handleDisconnected(const boost::optional<Connection::Error>& error);
void handleElement(boost::shared_ptr<Element>);
void handleStreamStart(const ProtocolHeader& header);
private:
String id_;
- boost::shared_ptr<Connection> connection_;
- PayloadParserFactoryCollection* payloadParserFactories_;
- PayloadSerializerCollection* payloadSerializers_;
UserRegistry* userRegistry_;
bool authenticated_;
- bool initialized_;
- boost::shared_ptr<XMPPLayer> xmppLayer_;
- boost::shared_ptr<ConnectionLayer> connectionLayer_;
- StreamStack* streamStack_;
JID domain_;
String user_;
JID jid_;