lichao
2021-04-06 3e9f5b869dd32441fdd3d77091cb33ef4301f244
src/pubsub.cpp
@@ -30,7 +30,7 @@
         return false;
      }
      DEFER1(imsg.Release(shm()));
      return ShmMsgQueue::Send(shm(), kBHTopicBus, imsg, timeout_ms);
      return ShmMsgQueue::Send(shm(), BHTopicBusAddress(), imsg, timeout_ms);
   } catch (...) {
      return false;
   }
@@ -39,7 +39,7 @@
bool SocketSubscribe::Subscribe(const std::vector<Topic> &topics, const int timeout_ms)
{
   try {
      return mq().Send(kBHTopicBus, MakeSub(mq().Id(), topics), timeout_ms);
      return mq().Send(BHTopicBusAddress(), MakeSub(mq().Id(), topics), timeout_ms);
   } catch (...) {
      return false;
   }
@@ -49,7 +49,7 @@
{
   auto AsyncRecvProc = [this, tdcb](BHMsg &msg) {
      if (msg.type() == kMsgTypePublish) {
         DataPub d;
         MsgPub d;
         if (d.ParseFromString(msg.body())) {
            tdcb(d.topic(), d.data());
         }
@@ -65,7 +65,7 @@
{
   BHMsg msg;
   if (SyncRecv(msg, timeout_ms) && msg.type() == kMsgTypePublish) {
      DataPub d;
      MsgPub d;
      if (d.ParseFromString(msg.body())) {
         d.mutable_topic()->swap(topic);
         d.mutable_data()->swap(data);