int zcm_blocking_t::handleOneMessage() { Msg *m = recvQueue.top(); // If the Queue was forcibly woken-up, recheck the // running condition, and then retry. if (m == nullptr) return -1; dispatchMsg(m->get()); recvQueue.pop(); return 0; }
void zcm_blocking_t::sendThreadFunc() { while (sendRunning) { Msg *m = sendQueue.top(); // If the Queue was forcibly woken-up, recheck the // running condition, and then retry. if (m == nullptr) continue; zcm_msg_t *msg = m->get(); int ret = zcm_trans_sendmsg(zt, *msg); if (ret != ZCM_EOK) ZCM_DEBUG("zcm_trans_sendmsg() failed to return EOK.. dropping the msg!"); sendQueue.pop(); } }