Improvements to TestPeer and PeerTest classes

This commit is contained in:
Vinnie Falco
2013-08-14 10:20:47 -07:00
parent 5e5b49d4e2
commit a3ab23a36a
9 changed files with 150 additions and 27 deletions

View File

@@ -135,10 +135,18 @@ void TestPeerLogicAsyncClient::on_shutdown (error_code const& ec)
{
if (success (error (ec), true))
{
if (success (socket ().close (error ())))
if (socket ().requires_handshake ())
{
// doing nothing here is intended,
// as the calls to success() may set error()
socket ().shutdown (Socket::shutdown_both, error ());
}
if (! error ())
{
if (success (socket ().close (error ())))
{
// doing nothing here is intended,
// as the calls to success() may set error()
}
}
}
}