diff options
Diffstat (limited to 'Swiften/StreamStack/ConnectionLayer.h')
-rw-r--r-- | Swiften/StreamStack/ConnectionLayer.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h index 0da0900..6776751 100644 --- a/Swiften/StreamStack/ConnectionLayer.h +++ b/Swiften/StreamStack/ConnectionLayer.h @@ -6,29 +6,25 @@ #pragma once -#include "Swiften/Base/boost_bsignals.h" #include <boost/shared_ptr.hpp> -#include <boost/bind.hpp> -#include "Swiften/StreamStack/LowLayer.h" -#include "Swiften/Network/Connection.h" +#include <Swiften/StreamStack/LowLayer.h> +#include <Swiften/Network/Connection.h> namespace Swift { class ConnectionLayer : public LowLayer { public: - ConnectionLayer(boost::shared_ptr<Connection> connection) : connection(connection) { - connection->onDataRead.connect(boost::bind(&ConnectionLayer::writeDataToParentLayer, this, _1)); - } - - ~ConnectionLayer() { - connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::writeDataToParentLayer, this, _1)); - } + ConnectionLayer(boost::shared_ptr<Connection> connection); + ~ConnectionLayer(); - void writeData(const ByteArray& data) { + void writeData(const SafeByteArray& data) { connection->write(data); } private: + void handleDataRead(boost::shared_ptr<SafeByteArray>); + + private: boost::shared_ptr<Connection> connection; }; } |