Squelch harmless not_connected errors

This commit is contained in:
Vinnie Falco
2017-07-20 08:15:27 -07:00
parent 5613ce7e97
commit f4c65a5ba6
8 changed files with 22 additions and 12 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ main(int, char const*[])
// "half-close" here to shut down our end.
//
sock.shutdown(tcp::socket::shutdown_send, ec);
if(ec)
if(ec && ec != beast::errc::not_connected)
return fail("shutdown", ec);
}
if(ec)
@@ -134,7 +134,7 @@ main(int, char const*[])
// Now we do the other half of the close,
// which is to shut down the receiver.
sock.shutdown(tcp::socket::shutdown_receive, ec);
if(ec)
if(ec && ec != beast::errc::not_connected)
return fail("shutdown", ec);
std::cout << res << std::endl;