Hi! See below for my call stack information at the moment of error. I will try
to investigate a little on my own, even though I am not very experienced at c++
or boost.
For convieniency, here is the method that seems to fail:
boost::asio::ip::address_v4 address::to_v4() const
{
if (type_ != ipv4)
{
std::bad_cast ex;
boost::throw_exception(ex);
}
return ipv4_address_;
}
Seems that type_ != ipv4, though I have no idea why. It seems to be
some win-specific implementation above in the stack-trace, which would explain
why it works on Ubuntu.
Sorry if I am wasting your time!
Best regards, Max Malmgren
KernelBase.dll!76bcb727()
[Frames below may be incorrect and/or missing, no symbols loaded for
KernelBase.dll]
KernelBase.dll!76bcb727()
msvcr100.dll!std::bad_cast::bad_cast(const std::bad_cast & that) Line
75 + 0x10 bytes C++
81fd17b7()
msvcr100.dll!_CxxThrowException(void * pExceptionObject, const
_s__ThrowInfo * pThrowInfo) Line 157 C++
NativeCodeTest.exe!boost::throw_exception<std::bad_cast>(const
std::bad_cast & e) Line 61 + 0x2e bytes C++
> NativeCodeTest.exe!boost::asio::ip::address::to_v4() Line 91 C++
NativeCodeTest.exe!boost::network::http::async_connection<boost::network::http::tags::http_async_server,proxy::ASyncProxy>::start()
Line 313 + 0x5a bytes C++
NativeCodeTest.exe!boost::network::http::async_server_base<boost::network::http::tags::http_async_server,proxy::ASyncProxy>::handle_accept(const
boost::system::error_code & ec) Line 71 C++
NativeCodeTest.exe!boost::asio::asio_handler_invoke<boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,boost::network::http::sync_server_base<boost::network::http::tags::http_server,proxy::SyncProxy>,boost::system::error_code
const
&>,boost::_bi::list2<boost::_bi::value<boost::network::http::sync_server_base<boost::network::http::tags::http_server,proxy::SyncProxy>
*>,boost::arg<1> > >,boost::system::error_code>
>(boost::asio::detail::binder1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,boost::network::http::sync_server_base<boost::network::http::tags::http_server,proxy::SyncProxy>,boost::system::error_code
const
&>,boost::_bi::list2<boost::_bi::value<boost::network::http::sync_server_base<boost::network::http::tags::http_server,proxy::SyncProxy>
*>,boost::arg<1> > >,boost::system::error_code> function, ...) Line 65 C++
NativeCodeTest.exe!boost::asio::detail::win_iocp_socket_accept_op<boost::asio::basic_socket<boost::asio::ip::tcp,boost::asio::stream_socket_service<boost::asio::ip::tcp>
>,boost::asio::ip::tcp,boost::_bi::bind_t<void,boost::_mfi::mf1<void,boost::network::http::async_server_base<boost::network::http::tags::http_async_server,proxy::ASyncProxy>,boost::system::error_code
const
&>,boost::_bi::list2<boost::_bi::value<boost::network::http::async_server_base<boost::network::http::tags::http_async_server,proxy::ASyncProxy>
*>,boost::arg<1> > > >::do_complete(boost::asio::detail::win_iocp_io_service *
owner, boost::asio::detail::win_iocp_operation * base,
boost::system::error_code ec, unsigned int __formal) Line 136 + 0x2a bytes
C++
NativeCodeTest.exe!boost::asio::detail::win_iocp_io_service::do_one(bool block,
boost::system::error_code & ec) Line 386 + 0x10 bytes C++
NativeCodeTest.exe!boost::asio::detail::win_iocp_io_service::run(boost::system::error_code
& ec) Line 160 + 0xb bytes C++
NativeCodeTest.exe!boost::asio::io_service::run() Line 58 C++
NativeCodeTest.exe!proxy::ASyncProxy::startProxy(std::basic_string<char,std::char_traits<char>,std::allocator<char>
> url, std::basic_string<char,std::char_traits<char>,std::allocator<char> >
port) Line 14 C++
NativeCodeTest.exe!StartASyncProxy(char * port, char * url) Line 64
C++
NativeCodeTest.exe!main() Line 76 + 0xf bytes C++
NativeCodeTest.exe!__tmainCRTStartup() Line 555 + 0x17 bytes C
kernel32.dll!76363677()
ntdll.dll!776b9d42()
ntdll.dll!776b9d15()
________________________________________
From: Oleg Malashenko [[email protected]]
Sent: Friday, January 21, 2011 2:39 AM
To: C++ Networking Library Developers Mailing List
Subject: Re: [cpp-netlib-devel] cpp-netlib async server request - bad cast
exception thrown
Hello, Max,
On 21.01.2011 00:41, Max Malmgren wrote:
> Originally I got a compile error, but once I included boost/or.hpp in
> the boost/network/version.hpp file it compiled. However, it still
> does not work on my windows distribution, while it does on my ubuntu
> distribution. I still get a bad_cast exception thrown.
Can you please run it under MSVS debugger and post a backtrace from the
point where exception is thrown? It shouldn't be a problem.
--
Best regards,
Oleg Malashenko.
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel