test_socket/bus_test.cpp
@@ -25,7 +25,8 @@ int size; int key; ShmModSocket *sk = (ShmModSocket *)skptr; while (sk->recvfrom( &recvbuf, &size, &key) == 0) { while ( true) { sk->recvfrom( &recvbuf, &size, &key); printf("收到订阅消息:%s\n", recvbuf); free(recvbuf); } @@ -36,7 +37,7 @@ ShmModSocket *sk = new ShmModSocket(); pthread_t tid; pthread_create(&tid, NULL, run_recv, (void *)socket); pthread_create(&tid, NULL, run_recv, (void *)sk); int size; char action[512];