I am migrating a project from VS 2008 to Vs 2012 and in the process updated boost from 1.40 to 1.53. After days and weeks of project settings, editing third party source (not boost), playing with configurations, etc. I got a build! Unfortunately one of the unit tests has an unhandled exception. I debugged down into code that was foreign to me and see that someone was calling shutdown on a boost socket. Maybe they called it at the wrong time or already shut it down, or something. It isn't my code. However, this looks very suspicious to me: in boost's header basic_socket.hpp: void shutdown(shutdown_type what) { boost::system::error_code ec; this->get_service().shutdown(this->get_implementation(), what, ec); boost::asio::detail::throw_error(ec, "shutdown"); } I don't see how this would not throw? It looks like it _always_ throws? What's the deal here?
On 7/1/2013 6:08 PM, Christopher Pisz wrote:
in boost's header basic_socket.hpp:
void shutdown(shutdown_type what) { boost::system::error_code ec; this->get_service().shutdown(this->get_implementation(), what, ec); boost::asio::detail::throw_error(ec, "shutdown"); }
I don't see how this would not throw? It looks like it _always_ throws? What's the deal here?
The ec value is 10054 btw. I'm not sure where I can look those up. Where to look?
If you take a look at 'boost\asio\detail\throw_error.hpp' you can see that boost::system::error_code is checked prior to the throw. 10054 is most likely a Windows API error. In Visual Studio run 'Tools->Error Lookup'. Results: Value: 10054 Error Message: An existing connection was forcibly closed by the remote host. -----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Christopher Pisz Sent: Monday, 01 July 2013 04:13 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] basic_socket.hpp line 1421 On 7/1/2013 6:08 PM, Christopher Pisz wrote:
in boost's header basic_socket.hpp:
void shutdown(shutdown_type what) { boost::system::error_code ec; this->get_service().shutdown(this->get_implementation(), what, ec); boost::asio::detail::throw_error(ec, "shutdown"); }
I don't see how this would not throw? It looks like it _always_ throws? What's the deal here?
The ec value is 10054 btw. I'm not sure where I can look those up. Where to look? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Christopher Pisz
-
Jim Wilburn