[asio] Assertion failed at run time

Hi,I'm new to boost and asio. I'm trying to use the ssl support of asio in a simple client.This is the code that i'm using to connect to the server: boost::asio::io_service io_service; boost::asio::ssl::context * ctx; boost::asio::ssl::streamboost::asio::ip::tcp::socket * socket; boost::asio::error Error; boost::asio::ip::tcp::resolver resolver(io_service); boost::asio::ip::tcp::resolver::query query(boost::asio::ip::tcp::v4(),hostname,port ); boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query,boost::asio::assign_error(Error)); boost::asio::ip::tcp::resolver::iterator end; if(Error) return false; ctx = new boost::asio::ssl::context(io_service, boost::asio::ssl::context::sslv23); boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; socket = new boost::asio::ssl::streamboost::asio::ip::tcp::socket(io_service,*ctx); Error = boost::asio::error::host_not_found; while (Error && endpoint_iterator != end) { socket->lowest_layer().close(); socket->lowest_layer().connect(endpoint,boost::asio::assign_error(Error)); } if (Error) return false; socket->handshake(boost::asio::ssl::stream_base::client,boost::asio::assign_error(Error)); if (Error) return false; else return true;That compiles fine but at run time i have this assertion exception:Assertion failed!Program:... //it is written like thatFile: (PATH)\boost-1_33_1\...\shared_ptr.hLine: 253Expression: px != 0I'm using vs2005. i can't see what is happening because evenif i'm using the "Step Into new Instance" mode to run the program in debug mode, the exception is fired before any step. This is the call stack: msvcr80d.dll!_wassert(const wchar_t * expr=0x0093888c, const wchar_t * filename=0x009388a0, unsigned int lineno=253) Line 384 C CTest.exe!boost::shared_ptr

Well...
To know where this thing was coming from, i just started to comment out each
line of code and tested what was happenning.
I finally commented out all the code and the error was still there. Then
figured out that the error is appearing as soon as my code includes:
#include
-- View this message in context: http://www.nabble.com/-asio--Assertion-failed-at-run-time-tf3940290.html#a11... Sent from the Boost - Users mailing list archive at Nabble.com.

with boost 1.34.1 RC1 and asio 0.3.8 RC3 i don't have the problem no more. Sunsawe wrote:
-- View this message in context: http://www.nabble.com/-asio--Assertion-failed-at-run-time-tf3940290.html#a11... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Sawe Sun
-
Sunsawe