| | |
| | | * 创建 |
| | | */ |
| | | void * bus_server_socket_wrapper_open() { |
| | | logger->debug("===bus_server_socket_wrapper_open\n"); |
| | | BusServerSocket *sockt = new BusServerSocket; |
| | | return (void *)sockt; |
| | | } |
| | |
| | | |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | delete sockt; |
| | | logger->debug("===bus_server_socket_wrapper_close\n"); |
| | | } |
| | | |
| | | int bus_server_socket_wrapper_stop(void *_socket) { |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | return sockt->stop(); |
| | | } |
| | | /** |
| | | * 启动bus |
| | | * |
| | |
| | | int ret; |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | |
| | | if( (ret = sockt->force_bind(SHM_BUS_KEY)) == 0) { |
| | | if( (ret = sockt->bind(SHM_BUS_KEY)) == 0) { |
| | | return sockt->start(); |
| | | } else { |
| | | logger->error("start bus failed"); |
| | | return -1; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | int bus_server_socket_wrapper_data_get(void * _socket, int val) { |
| | | int ret; |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | |
| | | ret = sockt->get_data(val); |
| | | |
| | | return ret; |
| | | |
| | | } |
| | | |
| | | int bus_server_socket_wrapper_proc_check(void * _socket, int val, char *buf, int len, void **buf_ret, int *len_ret, \ |
| | | const struct timespec *timeout, const int flag) { |
| | | int ret; |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | |
| | | ret = sockt->check_proc(val, buf, len, buf_ret, len_ret, timeout, flag); |
| | | |
| | | return ret; |
| | | |
| | | } |
| | | |
| | | void bus_server_socket_wrapper_proc_release(void * _socket, int val) { |
| | | |
| | | BusServerSocket *sockt = (BusServerSocket *)_socket; |
| | | |
| | | sockt->remove_proc(val); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |