Example #1
0
 void Client::start(Builder& b, EventCall_var x) {
     if (!b.is_oneway()) {
         b.serial(serial++);
         is_active_flag = true;
     }
     io_service.post([_query=std::move(b.get()), _serial=b.serial(), _timeout=b.timeout(), x, this]() mutable {
         if (is_alive())
         {
             TRACE("write call (" << _query.size() << " bytes) to " << endpoint);
             write(std::move(_query));
             if (_serial) {
                 insert_waiter(x, _serial, _timeout);
             }
         } else {
             using namespace boost::system;
             x->push_error(make_error_code(errc::not_connected).message());
         }
     });
 }