wangzhengquan
2021-02-05 607ac3ae8bfc017e10a7907e69dcbc3ab2a0fb63
test_net_socket/test_bus_stop.cpp
@@ -8,8 +8,8 @@
static void * server_sockt;
static void sigint_handler(int sig) {
  bus_server_socket_wrapper_close(server_sockt);
static void stop_bus_handler(int sig) {
  bus_server_socket_wrapper_stop(server_sockt);
}
static void *_start_bus_(void *arg) {
@@ -20,14 +20,17 @@
  if(bus_server_socket_wrapper_start_bus(server_sockt) != 0) {
    printf("start bus failed\n");
  }
  printf("============_start_bus_ end\n" );
  bus_server_socket_wrapper_close(server_sockt);
  printf("============bus stopted\n" );
}
int main() {
 pthread_t tid;
 char action[512];
 signal(SIGINT,  sigint_handler);
 signal(SIGINT,  stop_bus_handler);
 signal(SIGTERM,  stop_bus_handler);
 shm_mm_wrapper_init(512);
 server_sockt = bus_server_socket_wrapper_open();
 pthread_create(&tid, NULL, _start_bus_,  NULL);