From 9bf199a4770b08c03d553129757d960b605e598a Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 14 五月 2021 18:05:21 +0800 Subject: [PATCH] add center info at fixed address in shm. --- src/socket.cpp | 22 +++++----------------- 1 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/socket.cpp b/src/socket.cpp index 0704174..4f09517 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -28,25 +28,13 @@ using namespace bhome_shm; ShmSocket::ShmSocket(Shm &shm, const MQId id, const int len) : - run_(false), mq_(id, shm, len), alloc_id_(0) -{ - Start(); -} + run_(false), mq_(shm, id, len), alloc_id_(0) { Start(); } ShmSocket::ShmSocket(Shm &shm, const bool create_or_else_find, const MQId id, const int len) : - run_(false), mq_(id, create_or_else_find, shm, len), alloc_id_(0) -{ - Start(); -} -ShmSocket::ShmSocket(bhome_shm::SharedMemory &shm, const int len) : - run_(false), mq_(shm, len), alloc_id_(0) -{ - Start(); -} + run_(false), mq_(shm, create_or_else_find, id, len), alloc_id_(0) { Start(); } +ShmSocket::ShmSocket(int64_t abs_addr, Shm &shm, const MQId id) : + run_(false), mq_(abs_addr, shm, id), alloc_id_(0) { Start(); } -ShmSocket::~ShmSocket() -{ - Stop(); -} +ShmSocket::~ShmSocket() { Stop(); } bool ShmSocket::Start(int nworker, const RecvCB &onData, const RawRecvCB &onRaw, const IdleCB &onIdle) { -- Gitblit v1.8.0