void initialize() override {
   CAF_LOG_TRACE("");
   super::initialize();
   this->setf(abstract_actor::is_initialized_flag);
   auto bhvr = make_behavior();
   CAF_LOG_DEBUG_IF(!bhvr, "make_behavior() did not return a behavior:"
                           << CAF_ARG2("alive", this->alive()));
   if (bhvr) {
     // make_behavior() did return a behavior instead of using become()
     CAF_LOG_DEBUG("make_behavior() did return a valid behavior");
     this->do_become(std::move(bhvr.unbox()), true);
   }
 }
Esempio n. 2
0
void acceptor::removed_from_loop(operation op) {
  CAF_LOG_TRACE(CAF_ARG2("fd", fd()) << CAF_ARG(op));
  if (op == operation::read)
    mgr_.reset();
}
Esempio n. 3
0
void acceptor::stop_reading() {
  CAF_LOG_TRACE(CAF_ARG2("fd", fd()));
  close_read_channel();
  passivate();
}
Esempio n. 4
0
void acceptor::start(acceptor_manager* mgr) {
  CAF_LOG_TRACE(CAF_ARG2("fd", fd()));
  CAF_ASSERT(mgr != nullptr);
  activate(mgr);
}