wangzhengquan
2020-07-28 f12c014371ec9dc9b0c62db3e45df90cc97e9b31
src/socket/include/dgram_mod_socket.h
@@ -25,6 +25,8 @@
*/
int dgram_mod_bind(void * _socket, int port);
int dgram_mod_force_bind(void * _socket, int port);
/**
 * 发送信息
 * @port 发送给谁
@@ -47,6 +49,31 @@
*/
int dgram_mod_sendandrecv(void * _socket, const void *send_buf, const int send_size, const int port, void **recv_buf, int *recv_size) ;
/**
 * 启动bus
 *
 * @return 0 成功, 其他值 失败的错误码
*/
int  dgram_mod_start_bus(void * _socket);
/**
 * 订阅指定主题
 * @topic 主题
 * @size 主题长度
 * @port 总线端口
 */
int  dgram_mod_sub(void * _socket, void *topic, int size, int port);
/**
 * 发布主题
 * @topic 主题
 * @content 主题内容
 * @port 总线端口
 */
int  dgram_mod_pub(void * _socket, void *topic, int topic_size, void *content, int content_size, int port);
/**
 * 获取soket端口号
 */
@@ -57,31 +84,6 @@
 * 释放存储接收信息的buf
 */
void dgram_mod_free(void *buf) ;
/**
 * 启动bus
 *
 * @return 0 成功, 其他值 失败的错误码
*/
int start_bus(void * _socket);
/**
 * 订阅指定主题
 * @topic 主题
 * @size 主题长度
 * @port 总线端口
 */
int sub(void * _socket, void *topic, int size, int port);
/**
 * 发布主题
 * @topic 主题
 * @content 主题内容
 * @port 总线端口
 */
int pub(void * _socket, void *topic, int topic_size, void *content, int content_size, int port);
#ifdef __cplusplus
}
#endif