- xbt_assert(get_state() == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
-
- if (src_buff_ != nullptr) { // Sender side
- on_sender_start(*Actor::self());
+ xbt_assert(get_state() == State::INITED || get_state() == State::STARTING,
+ "You cannot use %s() once your communication started (not implemented)", __FUNCTION__);
+ if (from_ != nullptr || to_ != nullptr) {
+ xbt_assert(from_ != nullptr && to_ != nullptr, "When either from_ or to_ is specified, both must be.");
+ xbt_assert(src_buff_ == nullptr && dst_buff_ == nullptr,
+ "Direct host-to-host communications cannot carry any data.");
+ pimpl_ = kernel::actor::simcall([this] {
+ auto res = new kernel::activity::CommImpl(this->from_, this->to_, this->get_remaining());
+ res->start();
+ return res;
+ });
+
+ } else if (src_buff_ != nullptr) { // Sender side
+ on_start(*this, true /* is_sender*/);