diff options
Diffstat (limited to 'src/Net/Listener.cpp')
-rw-r--r-- | src/Net/Listener.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Net/Listener.cpp b/src/Net/Listener.cpp index 780e862..2bdb189 100644 --- a/src/Net/Listener.cpp +++ b/src/Net/Listener.cpp @@ -19,9 +19,6 @@ #include "Listener.h" -#include <Core/Logger.h> -#include <Core/ThreadManager.h> - #include <cerrno> #include <cstring> #include <fcntl.h> @@ -48,7 +45,7 @@ void Listener::handleAccept(const boost::system::error_code &error, boost::share con->socket.async_handshake(boost::asio::ssl::stream_base::server, boost::bind(&Connection::handleHandshake, con, boost::asio::placeholders::error)); } - con.reset(new Connection(sslContext)); + con.reset(new Connection(application, sslContext)); acceptor.async_accept(con->socket.lowest_layer(), boost::bind(&Listener::handleAccept, this, boost::asio::placeholders::error, con)); } @@ -76,10 +73,11 @@ void Listener::handleDisconnect(boost::shared_ptr<Connection> con) { } -Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyFile0, +Listener::Listener(Core::Application *application0, const std::string &x905CertFile0, const std::string &x905KeyFile0, const boost::asio::ip::tcp::endpoint &address0) throw(Core::Exception) -: x905CertFile(x905CertFile0), x905KeyFile(x905KeyFile0), address(address0), acceptor(Core::ThreadManager::get()->getIOService(), address), -sslContext(Core::ThreadManager::get()->getIOService(), boost::asio::ssl::context::sslv23) +: application(application0), x905CertFile(x905CertFile0), x905KeyFile(x905KeyFile0), address(address0), +acceptor(application->getIOService(), address), sslContext(application->getIOService(), boost::asio::ssl::context::sslv23), +signal(application) { sslContext.set_options(boost::asio::ssl::context::default_workarounds | boost::asio::ssl::context::no_sslv2 @@ -89,7 +87,7 @@ sslContext(Core::ThreadManager::get()->getIOService(), boost::asio::ssl::context - boost::shared_ptr<Connection> con(new Connection(sslContext)); + boost::shared_ptr<Connection> con(new Connection(application, sslContext)); acceptor.async_accept(con->socket.lowest_layer(), boost::bind(&Listener::handleAccept, this, boost::asio::placeholders::error, con)); } |