From cb85aa8a8d02a3d6dc16e3f32e78da9e70f9c7f5 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期二, 02 二月 2021 17:49:21 +0800 Subject: [PATCH] update --- test_net_socket/net_mod_socket.sh | 65 ++++++++++++++++++++++++-------- 1 files changed, 48 insertions(+), 17 deletions(-) diff --git a/test_net_socket/net_mod_socket.sh b/test_net_socket/net_mod_socket.sh index 4ae2223..52eb54e 100755 --- a/test_net_socket/net_mod_socket.sh +++ b/test_net_socket/net_mod_socket.sh @@ -1,15 +1,17 @@ function server() { -# 寮�鍚痓us - ./test_net_mod_socket --fun="start_bus_server" --key=8 & server_pid=$! && echo "pid: ${server_pid}" -# 寮�鍚綉缁滆浆鍙戜唬鐞� + # 寮�鍚痓us + ./test_net_mod_socket --fun="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}" - -# 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃 - ./test_net_mod_socket --fun="start_reply" --key=11 & server_pid=$! && echo "pid: ${server_pid}" + # 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃 + ./test_net_mod_socket --fun="start_reply" --key=100 & server_pid=$! && echo "pid: ${server_pid}" + ./test_net_mod_socket --fun="start_reply" --key=101 & server_pid=$! && echo "pid: ${server_pid}" + ./test_net_mod_socket --fun="start_reply" --key=102 & server_pid=$! && echo "pid: ${server_pid}" } +# 浜や簰寮忓鎴风 function client() { # ./test_net_mod_socket --fun="start_net_client" \ @@ -18,20 +20,41 @@ ./test_net_mod_socket --fun="start_net_client" \ - --sendlist="localhost:5000:11" \ - --publist="localhost:5000:8" + --sendlist="localhost:5000:100" \ + --publist="localhost:5000" } -function mclient() { - ./test_net_mod_socket --fun="start_net_mclient" \ - --sendlist="localhost:5000:11" +# one_to_many send +function one_to_many() { + ./test_net_mod_socket --fun="one_sendto_many" \ + --sendlist=" :5000:100, :5000:101, :5000:102" + +} + +# +function send() { + ./test_net_mod_socket --fun="test_net_sendandrecv" \ + --sendlist=" :5000:100, :5000:101, :5000:102" + +} + +# 鏃犻檺寰幆 pub +function pub() { + ./test_net_mod_socket --fun="test_net_pub" \ + --publist="localhost:5000, localhost:5000" + +} +# 澶氱嚎绋媝ub +function mpub() { + ./test_net_mod_socket --fun="test_net_pub_threads" \ + --publist="localhost:5000, localhost:5000" } function close() { - ps -ef | grep -e "dgram_mod_req_rep" -e "net_mod_socket" -e "dgram_mod_bus" | awk '{print $2}' | xargs -i kill -9 {} + ps -ef | grep -e "test_net_mod_socket" -e "heart_beat"| awk '{print $2}' | xargs -i kill -9 {} ipcrm -a } @@ -43,27 +66,35 @@ case ${1} in "server") - close server ;; "client") client ;; - "mclient") - - mclient + "one_to_many") + one_to_many + ;; + "send") + send + ;; + "mpub") + mpub + ;; + "pub") + pub ;; "close") close ;; "") close + sleep 2 server client ;; *) - echo "error input" + echo "argument input error" exit 1 ;; esac -- Gitblit v1.8.0