diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-02-03 19:27:12 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-02-03 19:27:12 (GMT) |
commit | 5b9e776a70fa83aafa83a02ea1dc04c06f02734f (patch) | |
tree | 6eaabcc5fe1cf087deff79774e043c4719fc1980 /Swiften/Network/BoostConnection.cpp | |
parent | 7e0df026a7ffc410ee1b679590025fa68b6af133 (diff) | |
download | swift-5b9e776a70fa83aafa83a02ea1dc04c06f02734f.zip swift-5b9e776a70fa83aafa83a02ea1dc04c06f02734f.tar.bz2 |
Call shutdown() on socket before close().
As recommended by boost asio documentation.
Diffstat (limited to 'Swiften/Network/BoostConnection.cpp')
-rw-r--r-- | Swiften/Network/BoostConnection.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Swiften/Network/BoostConnection.cpp b/Swiften/Network/BoostConnection.cpp index 7b997b4..b6b2d9d 100644 --- a/Swiften/Network/BoostConnection.cpp +++ b/Swiften/Network/BoostConnection.cpp @@ -79,6 +79,7 @@ void BoostConnection::disconnect() { if (writing_) { closeSocketAfterNextWrite_ = true; } else { + socket_.shutdown(); socket_.close(); } } @@ -148,6 +149,7 @@ void BoostConnection::handleDataWritten(const boost::system::error_code& error) if (writeQueue_.empty()) { writing_ = false; if (closeSocketAfterNextWrite_) { + socket_.shutdown(); socket_.close(); } } |