From 377e395a5fdc6ad44bdd5a2d41d2930f45fc4384 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 30 四月 2021 18:25:33 +0800 Subject: [PATCH] add node init msg, alloc msgq on success. --- src/socket.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/socket.h b/src/socket.h index a5dd72c..bd85fec 100644 --- a/src/socket.h +++ b/src/socket.h @@ -42,6 +42,7 @@ public: typedef ShmMsgQueue::MQId MQId; typedef bhome_shm::SharedMemory Shm; + typedef std::function<void(ShmSocket &sock, MsgI &imsg)> RawRecvCB; typedef std::function<void(ShmSocket &sock, MsgI &imsg, BHMsgHead &head)> RecvCB; typedef std::function<bool(ShmSocket &sock, MsgI &imsg, BHMsgHead &head)> PartialRecvCB; typedef std::function<void(ShmSocket &sock)> IdleCB; @@ -53,6 +54,7 @@ bool Remove() { return Remove(shm(), id()); } MQId id() const { return mq().Id(); } // start recv. + bool Start(const RawRecvCB &onData, const IdleCB &onIdle, int nworker = 1); bool Start(int nworker = 1, const RecvCB &onData = RecvCB(), const IdleCB &onIdle = IdleCB()); bool Start(const RecvCB &onData, const IdleCB &onIdle, int nworker = 1) { return Start(nworker, onData, onIdle); } bool Start(const RecvCB &onData, int nworker = 1) { return Start(nworker, onData); } -- Gitblit v1.8.0