From 026bbfaf2b5d73a26b8e2fa49158883ef64c211b Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期四, 27 五月 2021 13:51:26 +0800 Subject: [PATCH] tcp server call center to send proxy requests. --- src/shm_socket.h | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/shm_socket.h b/src/shm_socket.h index bf78e89..9dfdd6b 100644 --- a/src/shm_socket.h +++ b/src/shm_socket.h @@ -68,16 +68,16 @@ bool RequestAlloc(const int64_t size, std::function<void(MsgI &msg)> const &onResult); + bool Send(const MQInfo &remote, const MsgI &msg, const std::string &msg_id, RecvCB &&cb); template <class Body> - bool Send(const MQInfo &remote, BHMsgHead &head, Body &body, RecvCB &&cb = RecvCB()) - { - return Send(remote, MsgI::Serialize(head, body), head.msg_id(), std::move(cb)); - } - template <class... T> - bool Send(const MQInfo &remote, const MsgI &imsg, T &&...t) - { - return SendImpl(remote, imsg, std::forward<decltype(t)>(t)...); - } + bool Send(const MQInfo &remote, BHMsgHead &head, Body &body, RecvCB &&cb) { return Send(remote, MsgI::Serialize(head, body), head.msg_id(), std::move(cb)); } + bool Send(const MQInfo &remote, std::string &&content, const std::string &msg_id, RecvCB &&cb); + + template <class Body> + bool Send(const MQInfo &remote, BHMsgHead &head, Body &body) { return Send(remote, MsgI::Serialize(head, body)); } + bool Send(const MQInfo &remote, std::string &&content); + bool Send(const MQInfo &remote, const MsgI &imsg) { return SendImpl(remote, imsg); } + template <class... T> bool Send(const MQInfo &remote, const int64_t cmd, T &&...t) { @@ -135,8 +135,6 @@ private: bool StopNoLock(); bool RunningNoLock() { return !workers_.empty(); } - - bool Send(const MQInfo &remote, std::string &&content, const std::string &msg_id, RecvCB &&cb = RecvCB()); template <class... Rest> bool SendImpl(Rest &&...rest) -- Gitblit v1.8.0