| | |
| | | { |
| | | auto onRecvWithPerMsgCB = [this, onData](ShmSocket &socket, MsgI &imsg, BHMsgHead &head) { |
| | | RecvCB cb; |
| | | if (async_cbs_->Find(head.msg_id(), cb)) { |
| | | if (per_msg_cbs_->Find(head.msg_id(), cb)) { |
| | | cb(socket, imsg, head); |
| | | } else if (onData) { |
| | | onData(socket, imsg, head); |
| | | } // else ignored, or dropped |
| | | } else { // else ignored, or dropped |
| | | } |
| | | }; |
| | | |
| | | auto recvLoopBody = [this, onRecvWithPerMsgCB, onIdle]() { |
| | |
| | | if (imsg.ParseHead(head)) { |
| | | onRecvWithPerMsgCB(*this, imsg, head); |
| | | } |
| | | } else if (onIdle) { |
| | | } |
| | | if (onIdle) { |
| | | onIdle(*this); |
| | | } |
| | | } catch (...) { |