| | |
| | | free(buf); |
| | | } |
| | | |
| | | int start_bus(void * _socket) { |
| | | int dgram_mod_start_bus(void * _socket) { |
| | | dgram_mod_socket_t * socket = (dgram_mod_socket_t *) _socket; |
| | | socket->topic_sub_map = new std::map<std::string, std::set<int> *>; |
| | | run_pubsub_proxy(socket); |
| | |
| | | /** |
| | | * @port 总线端口 |
| | | */ |
| | | int sub(void * _socket, void *topic, int size, int port) { |
| | | int dgram_mod_sub(void * _socket, void *topic, int size, int port) { |
| | | dgram_mod_socket_t * socket = (dgram_mod_socket_t *) _socket; |
| | | char buf[8192]; |
| | | snprintf(buf, 8192, "%ssub%s%s%s%s", ACTION_LIDENTIFIER, ACTION_RIDENTIFIER, TOPIC_LIDENTIFIER, (char *)topic, TOPIC_RIDENTIFIER); |
| | |
| | | /** |
| | | * @port 总线端口 |
| | | */ |
| | | int pub(void * _socket, void *topic, int topic_size, void *content, int content_size, int port) { |
| | | int dgram_mod_pub(void * _socket, void *topic, int topic_size, void *content, int content_size, int port) { |
| | | |
| | | dgram_mod_socket_t * socket = (dgram_mod_socket_t *) _socket; |
| | | int head_len; |