wzq
2020-08-22 cc6bec3330c29cc29f54d3e3d919d510f0197641
src/socket/include/dgram_mod_socket.h
@@ -6,6 +6,16 @@
extern "C" {
#endif
/**
 * 删除key对应的共享队列,并在bus里删除该key的订阅
 */
int dgram_mod_remove_key(int key);
/**
 * 批量删除key对应的共享队列,并在bus里删除该key的订阅
 */
int dgram_mod_remove_keys(int keys[], int length);
/**
 * 创建socket
@@ -56,10 +66,10 @@
 * @port 发送给谁
 * @return 0 成功, 其他值 失败的错误码
*/
int dgram_mod_sendandrecv(void * _socket, const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size) ;
int dgram_mod_sendandrecv(void * _socket, const void *send_buf, const int send_size, const int send_port, void **recv_buf, int *recv_size) ;
// 超时返回。 @sec 秒 , @nsec 纳秒
int dgram_mod_sendandrecv_timeout(void * _socket, const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size, int sec, int nsec) ;
int dgram_mod_sendandrecv_nowait(void * _socket, const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size) ;
int dgram_mod_sendandrecv_timeout(void * _socket, const void *send_buf, const int send_size, const int send_port, void **recv_buf, int *recv_size, int sec, int nsec) ;
int dgram_mod_sendandrecv_nowait(void * _socket, const void *send_buf, const int send_size, const int send_port, void **recv_buf, int *recv_size) ;
/**
@@ -81,6 +91,16 @@
int  dgram_mod_sub_nowait(void * _socket, void *topic, int size, int port);
/**
 * 取消订阅指定主题
 * @topic 主题,主题为空时取消全部订阅
 * @size 主题长度
 * @port 总线端口
 */
int  dgram_mod_desub(void * _socket, void *topic, int size, int port);
// 超时返回。 @sec 秒 , @nsec 纳秒
int  dgram_mod_desub_timeout(void * _socket, void *topic, int size, int port, int sec, int nsec);
int  dgram_mod_desub_nowait(void * _socket, void *topic, int size, int port);
/**
 * 发布主题