From f87b7233a94131a5fd1b3dfb1595226e2779fffa Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期四, 06 八月 2020 17:52:29 +0800 Subject: [PATCH] add remove key(s) and RequestWithTimeout --- libcsoftbus.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/libcsoftbus.c b/libcsoftbus.c index 11fc582..01c9f9a 100644 --- a/libcsoftbus.c +++ b/libcsoftbus.c @@ -405,6 +405,30 @@ return fn_dgram_socket_sub_nowait(s, topic, size, port); } +int wrap_fn_dgram_socket_desub(hcsoftbus lib, void *s, void *topic, int size, int port){ + if (!fn_dgram_socket_desub){ + fn_dgram_socket_desub = (tfn_dgram_socket_desub)dlsym(lib, l_dgram_socket_desub); + check_with_ret(fn_dgram_socket_desub, lib, -1); + } + return fn_dgram_socket_desub(s, topic, size, port); +} + +int wrap_fn_dgram_socket_desub_timeout(hcsoftbus lib, void *s, void *topic, int size, int port, int sec, int usec){ + if (!fn_dgram_socket_desub_timeout){ + fn_dgram_socket_desub_timeout = (tfn_dgram_socket_desub_timeout)dlsym(lib, l_dgram_socket_desub_timeout); + check_with_ret(fn_dgram_socket_desub_timeout, lib, -1); + } + return fn_dgram_socket_desub_timeout(s, topic, size, port, sec, usec); +} + +int wrap_fn_dgram_socket_desub_nowait(hcsoftbus lib, void *s, void *topic, int size, int port){ + if (!fn_dgram_socket_desub_nowait){ + fn_dgram_socket_desub_nowait = (tfn_dgram_socket_desub_nowait)dlsym(lib, l_dgram_socket_desub_nowait); + check_with_ret(fn_dgram_socket_desub_nowait, lib, -1); + } + return fn_dgram_socket_desub_nowait(s, topic, size, port); +} + int wrap_fn_dgram_socket_pub(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port){ if (!fn_dgram_socket_pub){ fn_dgram_socket_pub = (tfn_dgram_socket_pub)dlsym(lib, l_dgram_socket_pub); @@ -448,3 +472,18 @@ } } +int wrap_fn_dgram_remove_key(hcsoftbus lib, int key){ + if (!fn_dgram_remove_key){ + fn_dgram_remove_key = (tfn_dgram_remove_key)dlsym(lib, l_dgram_remove_key); + check_with_ret(fn_dgram_remove_key, lib, -1); + } + return fn_dgram_remove_key(key); +} + +int wrap_fn_dgram_remove_keys(hcsoftbus lib, void *keys, int length){ + if (!fn_dgram_remove_keys){ + fn_dgram_remove_keys = (tfn_dgram_remove_keys)dlsym(lib, l_dgram_remove_keys); + check_with_ret(fn_dgram_remove_keys, lib, -1); + } + return fn_dgram_remove_keys((int*)keys, length); +} \ No newline at end of file -- Gitblit v1.8.0