
Hi,
I am a newbie with Asio library and i got into crashing problem with the following code:
boost::system::error_code ec; boost::asio::ip::tcp::resolver resolver( m_hive->GetService() ); boost::asio::ip::tcp::resolver::query query( m_host, boost::lexical_cast< std::string >( m_port )); boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve( query );
When i run this in windows, i do not have any isssue but in Ubuntu, it works and after some more resolution of query, it crashes. I did install Miredo to activate Ipv6 but it did not help.
When the crash happens, i see this:
23:37.47 [dbg] [0x8ec0650] Exception: Host not found (authoritative) 23:37.47 [dbg] [0x8ec0650] Exception: Host not found (authoritative) terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::system::system_error
' what(): Host not found (authoritative) Aborted (core dumped)
Do you know what else is missing or what is wrong?
Thanks a lot, mustafa
Provided your output, this is not a crash but just the case of an unhandled exception. Take a look at this: http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/ip__basic... It says that resolve() throws an exception on error so you can either catch it or use the overload where you need to provide an error handle yourself (which is not much different since you need to handle errors anyway). Regards, Andreas