예제 #1
0
void message_handler::read_body() {
  memset(read_msg_.data(), '\0', read_msg_.length());
  boost::asio::async_read(socket_,
      boost::asio::buffer(read_msg_.body(), read_msg_.body_length()),
      [this](boost::system::error_code ec, std::size_t /*length*/) {
        if (!ec) {
          delivery(read_msg_.body());
          read_header();
        } else {
            std::cout << "Error Reading messge body " << ec << std::endl;
            //TODO Update the remove handler from list at EOF of disconnect
            ob.update_observer(client_id);
        }
      }
  );
}
예제 #2
0
 explicit
 reader(message<isRequest,
         basic_dynamic_body, Fields> const& m)
     : body_(m.body())
 {
 }
예제 #3
0
 explicit
 writer(message<isRequest,
         basic_dynamic_body, Fields>& msg)
     : body_(msg.body())
 {
 }
예제 #4
0
 explicit
 reader(message<isRequest,
         vector_body, Fields>& m)
     : body_(m.body())
 {
 }
예제 #5
0
 explicit
 writer(message<isRequest,
         vector_body, Fields> const& msg)
     : body_(msg.body())
 {
 }