From 5026f256928cc3d3d6768faa63249bd343a4dd74 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期二, 07 九月 2021 16:14:25 +0800
Subject: [PATCH] 调整defer C.BHFree的执行顺序
---
src/socket/bus_server_socket.h | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/socket/bus_server_socket.h b/src/socket/bus_server_socket.h
index 956271b..3052c8b 100644
--- a/src/socket/bus_server_socket.h
+++ b/src/socket/bus_server_socket.h
@@ -18,7 +18,6 @@
typedef std::set<int, std::less<int>, SHM_STL_Allocator<int> > SHMKeySet;
typedef std::map<SHMString, SHMKeySet *, std::less<SHMString>, SHM_STL_Allocator<std::pair<const SHMString, SHMKeySet *> > > SHMTopicSubMap;
-
class BusServerSocket {
private:
shm_socket_t *shm_socket;
@@ -29,14 +28,16 @@
private:
int destroy();
void _proxy_sub( char *topic, int key);
- void _proxy_pub( char *topic, void *buf, size_t size, int key);
- void *_run_proxy_();
+ void _proxy_pub( char *topic, char *buf, size_t size, int key);
+ int _run_proxy_();
// int parse_pubsub_topic(char *str, size_t size, char **_action, char **_topic, size_t *head_len );
void _proxy_desub( char *topic, int key);
void _proxy_desub_all(int key);
- static void foreach_subscripters(std::function<void(SHMKeySet *, int)> cb);
+ void _proxy_reg(const char *topic, size_t topic_size, const char *content, size_t content_size, int key, int flag);
+
+ static void foreach_subscripters(std::function<void(SHMKeySet *, int)> cb);
// static bool include_in_keys(int key, int keys[], size_t length);
public:
--
Gitblit v1.8.0