From 4ad4f24f18cf7d0af22ca885baebc6a3eb37e7d0 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期四, 20 五月 2021 10:08:40 +0800 Subject: [PATCH] rename socket.h/cpp to shm_socket.h/cpp. --- src/shm_msg_queue.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shm_msg_queue.cpp b/src/shm_msg_queue.cpp index 663da1e..1d78e8c 100644 --- a/src/shm_msg_queue.cpp +++ b/src/shm_msg_queue.cpp @@ -33,7 +33,7 @@ ShmMsgQueue::MQId ShmMsgQueue::NewId() { - static auto &id = GetData(); + static auto &id = GetData("Must init shared memory before use! Please make sure center is running."); return (++id) * 10; } @@ -96,11 +96,11 @@ return Shmq::Find(shm, MsgQIdToName(remote_id)); } -bool ShmMsgQueue::TrySend(SharedMemory &shm, const MQId remote, int64_t val) +bool ShmMsgQueue::TrySend(SharedMemory &shm, const MQInfo &remote, const RawData val) { try { //TODO find from center, or use offset. - ShmMsgQueue dest(shm, false, remote, 1); + ShmMsgQueue dest(remote.offset_, shm, remote.id_); #ifndef BH_USE_ATOMIC_Q Guard lock(GetMutex(remote_id)); #endif -- Gitblit v1.8.0