lichao
2021-04-26 1b167ec5ad101ac44451381e26cc73ab5d67d2a1
src/socket.cpp
@@ -65,7 +65,8 @@
               onRecvWithPerMsgCB(*this, imsg, head);
            }
         };
         return mq().TryRecvAll(onMsg) > 0; // this will recv all msgs.
         MsgI imsg;
         return mq().TryRecv(imsg) ? (onMsg(imsg), true) : false;
      };
      try {
@@ -74,6 +75,8 @@
         if (onIdle) { onIdle(*this); }
         if (!more_to_send && !more_to_recv) {
            std::this_thread::yield();
            using namespace std::chrono_literals;
            std::this_thread::sleep_for(10000ns);
         }
      } catch (...) {
      }