diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-19 11:44:20 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-19 11:59:04 (GMT) |
commit | 1de12ed346fc0018527afe082886129088e27a95 (patch) | |
tree | 16013a9294588f505a559a99fe27a603584f2ac2 /Swiften/Network/BoostConnection.cpp | |
parent | 5d504472c63b7acaa7df99ff1097024cf463f1bd (diff) | |
download | swift-contrib-1de12ed346fc0018527afe082886129088e27a95.zip swift-contrib-1de12ed346fc0018527afe082886129088e27a95.tar.bz2 |
(Client)Session & Connection refactoring.
ClientSession no longer sets up a connection.
Connection no longer resolves addresses.
Diffstat (limited to 'Swiften/Network/BoostConnection.cpp')
-rw-r--r-- | Swiften/Network/BoostConnection.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp index b064c7a..9f2a7da 100644 --- a/Swiften/Network/BoostConnection.cpp +++ b/Swiften/Network/BoostConnection.cpp @@ -48,16 +48,6 @@ void BoostConnection::listen() { doRead(); } -void BoostConnection::connect(const String& domain) { - DomainNameResolver resolver; - try { - connect(resolver.resolve(domain.getUTF8String())); - } - catch (const DomainNameResolveException& e) { - onDisconnected(DomainNameResolveError); - } -} - void BoostConnection::connect(const HostAddressPort& addressPort) { boost::asio::ip::tcp::endpoint endpoint( boost::asio::ip::address::from_string(addressPort.getAddress().toString()), addressPort.getPort()); @@ -78,11 +68,11 @@ void BoostConnection::write(const ByteArray& data) { void BoostConnection::handleConnectFinished(const boost::system::error_code& error) { if (!error) { - MainEventLoop::postEvent(boost::bind(boost::ref(onConnected)), shared_from_this()); + MainEventLoop::postEvent(boost::bind(boost::ref(onConnectFinished), false), shared_from_this()); doRead(); } else if (error != boost::asio::error::operation_aborted) { - MainEventLoop::postEvent(boost::bind(boost::ref(onDisconnected), ConnectionError), shared_from_this()); + MainEventLoop::postEvent(boost::bind(boost::ref(onConnectFinished), true), shared_from_this()); } } |