diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-01-22 14:00:01 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-01-22 14:00:01 (GMT) |
commit | df029015f47f284ced01b8d1f11c4d48cc2f2564 (patch) | |
tree | 455d47a7fcb0d9d90bef6a6c63bdc7120eaec286 /Swiften/Session | |
parent | 940cb5e744564ec15b805a9e5388e1fa5c60d703 (diff) | |
download | swift-contrib-df029015f47f284ced01b8d1f11c4d48cc2f2564.zip swift-contrib-df029015f47f284ced01b8d1f11c4d48cc2f2564.tar.bz2 |
Close connection properly before quitting.
Diffstat (limited to 'Swiften/Session')
-rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 6 | ||||
-rw-r--r-- | Swiften/Session/BasicSessionStream.h | 3 | ||||
-rw-r--r-- | Swiften/Session/SessionStream.h | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 5377e6c..03985bd 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -88,7 +88,11 @@ void BasicSessionStream::writeFooter() { xmppLayer->writeFooter(); } -bool BasicSessionStream::isAvailable() { +void BasicSessionStream::close() { + connection->disconnect(); +} + +bool BasicSessionStream::isOpen() { return available; } diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h index 330db9d..747177a 100644 --- a/Swiften/Session/BasicSessionStream.h +++ b/Swiften/Session/BasicSessionStream.h @@ -36,7 +36,8 @@ namespace Swift { ); ~BasicSessionStream(); - virtual bool isAvailable(); + virtual void close(); + virtual bool isOpen(); virtual void writeHeader(const ProtocolHeader& header); virtual void writeElement(boost::shared_ptr<Element>); diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h index 55082f4..d0f93ee 100644 --- a/Swiften/Session/SessionStream.h +++ b/Swiften/Session/SessionStream.h @@ -37,7 +37,8 @@ namespace Swift { virtual ~SessionStream(); - virtual bool isAvailable() = 0; + virtual void close() = 0; + virtual bool isOpen() = 0; virtual void writeHeader(const ProtocolHeader& header) = 0; virtual void writeFooter() = 0; |