12 May 20:22
[asio] async_write and callback order
From: Ricardo Abreu <gumbeto <at> gmail.com>
Subject: [asio] async_write and callback order
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-12 18:26:39 GMT
Subject: [asio] async_write and callback order
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-12 18:26:39 GMT
Hi all,
I tried to clarify this on the irc but no one was sure about it:
- when calling async_write multiple times, is there any guarantee
that the handle_write callback I pass is called in the same order?
For instance, I have the following code:
#include "TCPConnection.h"
#include <boost/bind.hpp>
#include <iostream>
using boost::system::error_code;
using boost::bind;
using namespace boost::asio;
using namespace boost::asio::ip;
namespace SockExperiment
{
//---------------------------------------------------------------------------------------
void TCPConnection::handleWrite(const error_code& error, size_t
bytes_transferred)
{
std::string tmp = mBuffer.front(); // Copy the first element
for printing
mBuffer.pop(); // erase the first element
std::cout << "writen msg \"" << tmp << "\".\n"
(Continue reading)
RSS Feed