| | |
| | | } |
| | | |
| | | |
| | | int NetModSocket::pub(net_node_t *node_arr, int arrlen, char *topic, int topic_size, void *content, int content_size) { |
| | | int NetModSocket::pub(net_node_t *node_arr, int arrlen, const char *topic, int topic_size, const void *content, int content_size) { |
| | | return _pub_(node_arr, arrlen, topic, topic_size, content, content_size, -1); |
| | | } |
| | | |
| | | int NetModSocket::pub_nowait(net_node_t *node_arr, int arrlen, char *topic, int topic_size, void *content, int content_size) { |
| | | int NetModSocket::pub_nowait(net_node_t *node_arr, int arrlen, const char *topic, int topic_size, const void *content, int content_size) { |
| | | return _pub_(node_arr, arrlen, topic, topic_size, content, content_size, 0); |
| | | } |
| | | |
| | | int NetModSocket::pub_timeout(net_node_t *node_arr, int arrlen, char *topic, int topic_size, void *content, int content_size, int msec ) { |
| | | int NetModSocket::pub_timeout(net_node_t *node_arr, int arrlen, const char *topic, int topic_size, const void *content, int content_size, int msec ) { |
| | | return _pub_(node_arr, arrlen, topic, topic_size, content, content_size, msec); |
| | | } |
| | | |
| | | |
| | | // int pub(char *topic, int topic_size, void *content, int content_size, int port); |
| | | |
| | | int NetModSocket::_pub_(net_node_t *node_arr, int arrlen, char *topic, int topic_size, void *content, |
| | | int NetModSocket::_pub_(net_node_t *node_arr, int arrlen, const char *topic, int topic_size, const void *content, |
| | | int content_size, int msec) { |
| | | int i, connfd; |
| | | net_node_t *node; |
| | |
| | | //====================================================================================== |
| | | |
| | | int NetModSocket::write_request(int clientfd, net_mod_request_head_t &request_head, |
| | | void *content_buf, int content_size, void *topic_buf, int topic_size) { |
| | | const void *content_buf, int content_size, const void *topic_buf, int topic_size) { |
| | | |
| | | int buf_size; |
| | | char *buf; |