From 27d8bc7cad4a8f68c2da3efbb77f45ec70ae40e6 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期三, 05 一月 2022 14:11:39 +0800 Subject: [PATCH] pb.go MsgQueryProcReply add subLocalTopics and subNetTopics --- test_net_socket/net_mod_socket.sh | 53 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 32 insertions(+), 21 deletions(-) diff --git a/test_net_socket/net_mod_socket.sh b/test_net_socket/net_mod_socket.sh index 4b41abc..d79752e 100755 --- a/test_net_socket/net_mod_socket.sh +++ b/test_net_socket/net_mod_socket.sh @@ -1,56 +1,67 @@ function server() { # 寮�鍚痓us - ./test_net_mod_socket --fun="start_bus_server" & server_pid=$! && echo "pid: ${server_pid}" + ./shm_util start_bus_server & server_pid=$! && echo "pid: ${server_pid}" # 寮�鍚綉缁滆浆鍙戜唬鐞� - ./test_net_mod_socket --fun="start_net_proxy" --port=5000 & server_pid=$! && echo "pid: ${server_pid}" + ./shm_util start_net_proxy --port=5000 & server_pid=$! && echo "pid: ${server_pid}" # 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃 - ./test_net_mod_socket --fun="start_reply" --key=100 & server_pid=$! && echo "pid: ${server_pid}" + ./shm_util recvfrom --bind=100 & server_pid=$! && echo "pid: ${server_pid}" + ./shm_util recvfrom --bind=101 & server_pid=$! && echo "pid: ${server_pid}" + ./shm_util recvfrom --bind=102 & server_pid=$! && echo "pid: ${server_pid}" + + # 鎵撳紑鍥為槦鍒楁敹杩涚▼ + # ./shm_util start_resycle & server_pid=$! && echo "pid: ${server_pid}" } # 浜や簰寮忓鎴风 function client() { - - # ./test_net_mod_socket --fun="start_net_client" \ + # ./shm_util start_net_client \ # --sendlist="192.168.5.10:5000:11, 192.168.5.22:5000:11, 192.168.20.104:5000:11" \ # --publist="192.168.5.10:5000:8, 192.168.5.22:5000:8, 192.168.20.104:5000:8" - ./test_net_mod_socket --fun="start_net_client" \ - --sendlist="localhost:5000:100" \ + ./shm_util start_net_client \ + --sendlist=" :5000:100" \ --publist="localhost:5000" } -# 鏃犻檺寰幆send +# one_to_many send +function one_to_many() { + ./shm_util one_sendto_many \ + --sendlist=" :5000:100, :5000:101, :5000:102" + +} + +# function send() { - ./test_net_mod_socket --fun="test_net_sendandrecv" \ - --sendlist="localhost:5000:100, localhost:5000:100" + ./shm_util test_net_sendandrecv \ + --sendlist=" :5000:100, :5000:101, :5000:102" } -# 澶氱嚎绋媠end -function msend() { - ./test_net_mod_socket --fun="test_net_sendandrecv_threads" \ - --sendlist="localhost:5000:100, localhost:5000:100" - -} + # 鏃犻檺寰幆 pub function pub() { - ./test_net_mod_socket --fun="test_net_pub" \ + ./shm_util test_net_pub \ --publist="localhost:5000, localhost:5000" } # 澶氱嚎绋媝ub function mpub() { - ./test_net_mod_socket --fun="test_net_pub_threads" \ + ./shm_util test_net_pub_threads \ --publist="localhost:5000, localhost:5000" } +function stop() { + ps -ef | grep -e "shm_util" -e "heart_beat"| awk '{print $2}' | xargs -i kill -15 {} + +} + function close() { - ps -ef | grep -e "test_net_mod_socket" -e "heart_beat"| awk '{print $2}' | xargs -i kill -9 {} + ps -ef | grep -e "shm_util" -e "heart_beat"| awk '{print $2}' | xargs -i kill -9 {} ipcrm -a } @@ -67,8 +78,8 @@ "client") client ;; - "msend") - msend + "one_to_many") + one_to_many ;; "send") send -- Gitblit v1.8.0