From c95e44f010c06f82d95d4264a90ec230e4bf307e Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期二, 01 十二月 2020 17:52:08 +0800
Subject: [PATCH] add server socket

---
 libcbhomebus.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/libcbhomebus.c b/libcbhomebus.c
index 9aa0240..9046a11 100644
--- a/libcbhomebus.c
+++ b/libcbhomebus.c
@@ -328,4 +328,28 @@
         check_with_ret(fn_socket_remove_keys, lib, -1);
     }
     return fn_socket_remove_keys((int*)keys, length);
-}
\ No newline at end of file
+}
+
+void *wrap_fn_server_socket_open(hbhomebus lib, int port){
+    if (!fn_server_socket_open){
+        fn_server_socket_open = (tfn_net_mod_server_socket_open)dlsym(lib, l_net_mod_server_socket_open);
+        check_with_ret(fn_server_socket_open, lib, NULL);
+    }
+    return fn_server_socket_open(port);
+}
+
+void wrap_fn_server_socket_close(hbhomebus lib, void* _socket){
+    if (!fn_server_socket_close){
+        fn_server_socket_close = (tfn_net_mod_server_socket_close)dlsym(lib, l_net_mod_server_socket_close);
+        check_only(fn_server_socket_close, lib);
+    }
+    fn_server_socket_close(_socket);
+}
+
+int wrap_fn_server_socket_start(hbhomebus lib, void* _socket){
+    if (!fn_server_socket_start){
+        fn_server_socket_start = (tfn_net_mod_server_socket_start)dlsym(lib, l_net_mod_server_socket_start);
+        check_with_ret(fn_server_socket_start, lib, -1);
+    }
+    return fn_server_socket_start(_socket);
+}

--
Gitblit v1.8.0