Opened 12 years ago

Last modified 7 years ago

#5114 new Bugs

Unexpected exception from tcp::socket::async_connect

Reported by: pavel@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc: raad@…

Description

ASIO uses two sockets connected to each other through loopback interface (in select_reactor). If, for example, access to loopback is blocked by firewall, then async_connect throws exception, instead of calling given handler with appropriate error code.

Change History (2)

comment:1 by anonymous, 8 years ago

Also maybe similar problem reproduced in my application that using boost::asio (boost version 1.55.0): tcp::socket::async_connect throws boost::system::system_error with error code 10055 when another test application used ~16000 sockets on my windows 7 64-bit. The call stack is:

boost::throw_exception<boost::system::system_error>+0x97 [d:\lib\boost\include\boost\throw_exception.hpp @ 70] boost::asio::detail::do_throw_error+0x5e [d:\lib\boost\include\boost\asio\detail\impl\throw_error.ipp @ 39] boost::asio::detail::throw_error+0x1c [d:\lib\boost\include\boost\asio\detail\throw_error.hpp @ 42] boost::asio::detail::socket_select_interrupter::open_descriptors+0x12a [d:\lib\boost\include\boost\asio\detail\impl\socket_select_interrupter.ipp @ 66] boost::asio::detail::socket_select_interrupter::socket_select_interrupter+0x16 [d:\lib\boost\include\boost\asio\detail\impl\socket_select_interrupter.ipp @ 42] boost::asio::detail::select_reactor::select_reactor+0x82 [d:\lib\boost\include\boost\asio\detail\impl\select_reactor.ipp @ 48] boost::asio::detail::service_registry::create<boost::asio::detail::select_reactor>+0x63 [d:\lib\boost\include\boost\asio\detail\impl\service_registry.hpp @ 81] boost::asio::detail::service_registry::do_use_service+0xb3 [d:\lib\boost\include\boost\asio\detail\impl\service_registry.ipp @ 123] boost::asio::detail::service_registry::use_service<boost::asio::detail::select_reactor>+0x50 [d:\lib\boost\include\boost\asio\detail\impl\service_registry.hpp @ 49] boost::asio::use_service<boost::asio::detail::select_reactor>+0xe [d:\lib\boost\include\boost\asio\impl\io_service.hpp @ 34] boost::asio::detail::win_iocp_socket_service_base::get_reactor+0x3e [d:\lib\boost\include\boost\asio\detail\impl\win_iocp_socket_service_base.ipp @ 620] boost::asio::detail::win_iocp_socket_service_base::start_connect_op+0x2e [d:\lib\boost\include\boost\asio\detail\impl\win_iocp_socket_service_base.ipp @ 550] boost::asio::detail::win_iocp_socket_service<boost::asio::ip::tcp>::async_connect ...

comment:2 by raad@…, 7 years ago

Cc: raad@… added
Note: See TracTickets for help on using tickets.