错误时async_connect之称,是加速在Windows ASIO插座不能async_connect
uncaught exception of type N5boost16exception_detail10clone_implINS0_19error_info_injectorINS_6system12system_errorEEEEE
- socket_select_interrupter: The attempted operation is not supported for the type of object referenced
Demangled:
uncaught exception of type boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> > - socket_select_interrupter: The attempted operation is not supported for the type of object referenced
下面是一些相关的代码:
typedef boost::shared_ptr<boost::asio::ip::tcp::socket> tTCPSocketPtr;
boost::shared_ptr<boost::asio::io_service> ioService = boost::shared_ptr<boost::asio::io_service> (new boost::asio::io_service());
socketPtr = tTCPSocketPtr(new boost::asio::ip::tcp::socket(*ioService));
boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::address::from_string(this->ipAddress), this->port);
// Set a deadline for the connect operation.
deadline->expires_from_now(boost::posix_time::seconds(5));
socketPtr->async_connect(endpoint,
boost::bind(&AConnection::handle_connect,
shared_from_this(), _1, endpoint)); //errors out here
我已经使用Google搜索并没有发现任何有用的东西。
我该如何解决这个错误? 谢谢, sb
它不会出错'错误在这里'为简单异步操作不以内联方式执行的原因。所以你可能意思是说,如果你在那之前停下来(或者注释掉),你不会得到同样的错误? – sehe 2014-12-02 18:36:22