Use the second overload of shutdown() to ignore any errors while shutting down the socket (like endpoint being closed already).

Fixes bug #6074.

svn path=/trunk/rosev_ircsystem/; revision=1292
This commit is contained in:
Colin Finck 2011-05-28 22:57:11 +00:00
parent 6e77cbd8c1
commit fa76f9223a

View File

@ -347,7 +347,12 @@ CNetworkClient::Shutdown()
m_Timer.cancel();
boost::asio::ip::tcp::socket::lowest_layer_type& Socket = GetSocket();
Socket.shutdown(boost::asio::socket_base::shutdown_both);
/* Use the second overload of shutdown() to ignore any errors while shutting down the socket
(like endpoint being closed already). */
boost::system::error_code ErrorCode;
Socket.shutdown(boost::asio::socket_base::shutdown_both, ErrorCode);
Socket.close();
m_ShutdownCompleted = true;