Boost logo

Boost :

From: berserker_r (berserker_r_at_[hidden])
Date: 2006-11-15 09:07:39

> What OS are you using? Is the session's work CPU bound?

I'm on Windows XP, sry but I can't understand what you mean with the
second question...
Just take your sample in "server.cpp": I need to be able to change the
code (in the session or server object, dunno where...) so that the server
is always free to accept (and process) a new connections even if there are
one or more active sessions taking a very long time to generate and send
theirs response.
For example:

void Session::handle_read(const asio::error_code& err, size_t length)

      if (!err)
        read_data_length_ = length;
        if (unsent_count_ == 1)
          very_very_long_operation(); // Process the client request

          op_count_ += 2;
          std::swap(read_data_, write_data_);
          async_write(socket_, buffer(write_data_, read_data_length_),
                boost::bind(&session::handle_write, this,
          socket_.async_read_some(buffer(read_data_, block_size_),
                boost::bind(&session::handle_read, this,

      if (op_count_ == 0)
, this));

Session::very_very_long_operation() takes a lot of time :) I need in the
meanwhile to be able in the server to accept new connections, how can I do
that? I tried calling from multiple threads as the documentation
said but the server is always locked until the session's operation is

P.S.: be patient plz my english is not very good :)

Boost list run by bdawes at, gregod at, cpdaniel at, john at