From 0bde715af72b7b3d55ad3aac816d7cd153a60b42 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 03 八月 2020 13:29:21 +0800 Subject: [PATCH] add timeout api --- libcsoftbus.h | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/libcsoftbus.h b/libcsoftbus.h index 1885b61..f141f7a 100644 --- a/libcsoftbus.h +++ b/libcsoftbus.h @@ -52,11 +52,21 @@ static tfn_dgram_socket_bind fn_dgram_socket_bind = NULL; static tfn_dgram_socket_force_bind fn_dgram_socket_force_bind = NULL; static tfn_dgram_socket_sendto fn_dgram_socket_sendto = NULL; +static tfn_dgram_socket_sendto_timeout fn_dgram_socket_sendto_timeout = NULL; +static tfn_dgram_socket_sendto_nowait fn_dgram_socket_sendto_nowait = NULL; static tfn_dgram_socket_recvfrom fn_dgram_socket_recvfrom = NULL; +static tfn_dgram_socket_recvfrom_timeout fn_dgram_socket_recvfrom_timeout = NULL; +static tfn_dgram_socket_recvfrom_nowait fn_dgram_socket_recvfrom_nowait = NULL; static tfn_dgram_socket_sendandrecv fn_dgram_socket_sendandrecv = NULL; +static tfn_dgram_socket_sendandrecv_timeout fn_dgram_socket_sendandrecv_timeout = NULL; +static tfn_dgram_socket_sendandrecv_nowait fn_dgram_socket_sendandrecv_nowait = NULL; static tfn_dgram_socket_start_bus fn_dgram_socket_start_bus = NULL; static tfn_dgram_socket_sub fn_dgram_socket_sub = NULL; +static tfn_dgram_socket_sub_timeout fn_dgram_socket_sub_timeout = NULL; +static tfn_dgram_socket_sub_nowait fn_dgram_socket_sub_nowait = NULL; static tfn_dgram_socket_pub fn_dgram_socket_pub = NULL; +static tfn_dgram_socket_pub_timeout fn_dgram_socket_pub_timeout = NULL; +static tfn_dgram_socket_pub_nowait fn_dgram_socket_pub_nowait = NULL; static tfn_dgram_socket_port fn_dgram_socket_port = NULL; static tfn_dgram_socket_free fn_dgram_socket_free = NULL; @@ -107,11 +117,21 @@ const static char l_dgram_socket_bind[] = "dgram_mod_bind"; const static char l_dgram_socket_force_bind[] = "dgram_mod_force_bind"; const static char l_dgram_socket_sendto[] = "dgram_mod_sendto"; +const static char l_dgram_socket_sendto_timeout[] = "dgram_mod_sendto_timeout"; +const static char l_dgram_socket_sendto_nowait[] = "dgram_mod_sendto_nowait"; const static char l_dgram_socket_recvfrom[] = "dgram_mod_recvfrom"; +const static char l_dgram_socket_recvfrom_timeout[] = "dgram_mod_recvfrom_timeout"; +const static char l_dgram_socket_recvfrom_nowait[] = "dgram_mod_recvfrom_nowait"; const static char l_dgram_socket_sendandrecv[] = "dgram_mod_sendandrecv"; +const static char l_dgram_socket_sendandrecv_timeout[] = "dgram_mod_sendandrecv_timeout"; +const static char l_dgram_socket_sendandrecv_nowait[] = "dgram_mod_sendandrecv_nowait"; const static char l_dgram_socket_start_bus[] = "dgram_mod_start_bus"; const static char l_dgram_socket_sub[] = "dgram_mod_sub"; +const static char l_dgram_socket_sub_timeout[] = "dgram_mod_sub_timeout"; +const static char l_dgram_socket_sub_nowait[] = "dgram_mod_sub_nowait"; const static char l_dgram_socket_pub[] = "dgram_mod_pub"; +const static char l_dgram_socket_pub_timeout[] = "dgram_mod_pub_timeout"; +const static char l_dgram_socket_pub_nowait[] = "dgram_mod_pub_nowait"; const static char l_dgram_socket_port[] = "dgram_mod_get_port"; const static char l_dgram_socket_free[] = "dgram_mod_free"; @@ -168,11 +188,21 @@ int wrap_fn_dgram_socket_bind(hcsoftbus lib, void *s, int port); int wrap_fn_dgram_socket_force_bind(hcsoftbus lib, void *s, int port); int wrap_fn_dgram_socket_sendto(hcsoftbus lib, void *s, const void *buf, const int size, const int port); +int wrap_fn_dgram_socket_sendto_timeout(hcsoftbus lib, void *s, const void *buf, const int size, const int port, int sec, int usec); +int wrap_fn_dgram_socket_sendto_nowait(hcsoftbus lib, void *s, const void *buf, const int size, const int port); int wrap_fn_dgram_socket_recvfrom(hcsoftbus lib, void *s, void **buf, int *size, int *port); +int wrap_fn_dgram_socket_recvfrom_timeout(hcsoftbus lib, void *s, void **buf, int *size, int *port, int sec, int usec); +int wrap_fn_dgram_socket_recvfrom_nowait(hcsoftbus lib, void *s, void **buf, int *size, int *port); int wrap_fn_dgram_socket_sendandrecv(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize); +int wrap_fn_dgram_socket_sendandrecv_timeout(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize, int sec, int usec); +int wrap_fn_dgram_socket_sendandrecv_nowait(hcsoftbus lib, void *s, const void *sbuf, const int ssize, const int port, void **rbuf, int *rsize); int wrap_fn_dgram_socket_start_bus(hcsoftbus lib, void *s); int wrap_fn_dgram_socket_sub(hcsoftbus lib, void *s, void *topic, int size, int port); +int wrap_fn_dgram_socket_sub_timeout(hcsoftbus lib, void *s, void *topic, int size, int port, int sec, int usec); +int wrap_fn_dgram_socket_sub_nowait(hcsoftbus lib, void *s, void *topic, int size, int port); int wrap_fn_dgram_socket_pub(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port); +int wrap_fn_dgram_socket_pub_timeout(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port, int sec, int usec); +int wrap_fn_dgram_socket_pub_nowait(hcsoftbus lib, void *s, void *topic, int tsize, void *content, int csize, int port); int wrap_fn_dgram_socket_port(hcsoftbus lib, void *s); void wrap_fn_dgram_socket_free(hcsoftbus lib, void *buf); -- Gitblit v1.8.0