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
+5 -1
View File
@@ -78,7 +78,11 @@ int main()
// Gracefully close the socket
sock.shutdown(tcp::socket::shutdown_both, ec);
if(ec)
// not_connected happens sometimes
// so don't bother reporting it.
//
if(ec && ec != beast::errc::not_connected)
return fail("shutdown", ec);
// If we get here then the connection is closed gracefully