Boost logo

Boost Users :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2008-09-03 02:50:32


John Urberg wrote:
> I'm using async_send_to to send multicast messages. When I try to
> send data in a std::string, I always get a 'string iterator not
> dereferencable' assertion failure. I'm using boost 1.35 and VC9.
> Here's the code:
>
> // instance variable
> string buffer;
>
> // code in method
> buffer = BuildHailMessage();
> socket.async_send_to(
> boost::asio::buffer(buffer),
> endpoint,
> boost::bind(
> &MulticastServer::HandleSendTo,
> this,
> boost::asio::placeholders::error));

Do you keep the "buffer" string available until async_send_to has actually
completed?

/ Johan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net