diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-12 17:57:48 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-12 18:49:51 (GMT) |
commit | 72858ab262a16aa8db209c2898ab0d3c951a9829 (patch) | |
tree | 411ccedbf9bdd746ccb1f124e74fe91111d63a56 /Limber/main.cpp | |
parent | eb1338be843c53aa02fac0d38455aada3f89db0b (diff) | |
download | swift-contrib-72858ab262a16aa8db209c2898ab0d3c951a9829.zip swift-contrib-72858ab262a16aa8db209c2898ab0d3c951a9829.tar.bz2 |
Added ServerFromClientSession.
Diffstat (limited to 'Limber/main.cpp')
-rw-r--r-- | Limber/main.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Limber/main.cpp b/Limber/main.cpp index 8378c52..6dad151 100644 --- a/Limber/main.cpp +++ b/Limber/main.cpp @@ -11,38 +11,14 @@ #include "Swiften/Base/ByteArray.h" #include "Swiften/EventLoop/MainEventLoop.h" #include "Swiften/EventLoop/SimpleEventLoop.h" -#include "Swiften/Network/IncomingConnection.h" #include "Swiften/Network/ConnectionServer.h" #include "Swiften/Network/BoostIOServiceThread.h" +#include "Swiften/Server/ServerFromClientSession.h" #include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h" #include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h" using namespace Swift; -class ServerFromClientSession { - public: - ServerFromClientSession( - boost::shared_ptr<IncomingConnection> connection, - PayloadParserFactoryCollection* payloadParserFactories, - PayloadSerializerCollection* payloadSerializers) : - connection_(connection), - payloadParserFactories_(payloadParserFactories), - payloadSerializers_(payloadSerializers) { - } - - void start() { - connection_->write("Hello\n"); - onSessionFinished(); - } - - boost::signal<void()> onSessionFinished; - - private: - boost::shared_ptr<IncomingConnection> connection_; - PayloadParserFactoryCollection* payloadParserFactories_; - PayloadSerializerCollection* payloadSerializers_; -}; - // A reference-counted non-modifiable buffer class. class SharedBuffer { public: @@ -134,7 +110,6 @@ class Server { ServerFromClientSession* session = new ServerFromClientSession(c, &payloadParserFactories_, &payloadSerializers_); serverFromClientSessions_.push_back(session); session->onSessionFinished.connect(boost::bind(&Server::handleSessionFinished, this, session)); - session->start(); } void handleSessionFinished(ServerFromClientSession* session) { |