summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-19 11:44:20 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-19 11:59:04 (GMT)
commit1de12ed346fc0018527afe082886129088e27a95 (patch)
tree16013a9294588f505a559a99fe27a603584f2ac2 /Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
parent5d504472c63b7acaa7df99ff1097024cf463f1bd (diff)
downloadswift-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/LinkLocal/OutgoingLinkLocalSession.cpp')
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
index f32bcdd..f97520a 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
@@ -55,7 +55,7 @@ void OutgoingLinkLocalSession::handleHostnameResolved(const String& hostname, co
boost::shared_ptr<Connection> connection = connectionFactory_->createConnection();
setConnection(connection);
initializeStreamStack();
- connection->onConnected.connect(boost::bind(&OutgoingLinkLocalSession::handleConnected, boost::dynamic_pointer_cast<OutgoingLinkLocalSession>(shared_from_this())));
+ connection->onConnectFinished.connect(boost::bind(&OutgoingLinkLocalSession::handleConnected, boost::dynamic_pointer_cast<OutgoingLinkLocalSession>(shared_from_this()), _1));
connection->connect(HostAddressPort(*address, port_));
}
else {
@@ -65,10 +65,15 @@ void OutgoingLinkLocalSession::handleHostnameResolved(const String& hostname, co
}
}
-void OutgoingLinkLocalSession::handleConnected() {
- ProtocolHeader header;
- header.setFrom(getLocalJID());
- getXMPPLayer()->writeHeader(header);
+void OutgoingLinkLocalSession::handleConnected(bool error) {
+ if (!error) {
+ ProtocolHeader header;
+ header.setFrom(getLocalJID());
+ getXMPPLayer()->writeHeader(header);
+ }
+ else {
+ // TODO: Error
+ }
}
void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) {