From aa2f3b2a9968bb4928463bdae05fb026d16b60bb Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期五, 04 十二月 2020 19:07:01 +0800 Subject: [PATCH] 固定bus key --- test_net_socket/net_mod_socket.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 44 insertions(+), 13 deletions(-) diff --git a/test_net_socket/net_mod_socket.sh b/test_net_socket/net_mod_socket.sh index fdd8a5b..68d4ff1 100755 --- a/test_net_socket/net_mod_socket.sh +++ b/test_net_socket/net_mod_socket.sh @@ -1,25 +1,49 @@ function server() { - + + # 寮�鍚痓us + ./test_net_mod_socket --fun="start_bus_server" --key=8 & server_pid=$! && echo "pid: ${server_pid}" + # 寮�鍚綉缁滆浆鍙戜唬鐞� + ./test_net_mod_socket --fun="start_net_proxy" --port=5000 & server_pid=$! && echo "pid: ${server_pid}" -# 鎵撳紑璇锋眰搴旂瓟鐨剆erver - ./dgram_mod_req_rep server 11 & server_pid=$! && echo ${server_pid} - - -# 寮�鍚痓us - ./dgram_mod_bus server 8 & server_pid=$! && echo ${server_pid} - -# 寮�鍚綉缁渟erver - ./net_mod_socket server 5000 & server_pid=$! && echo ${server_pid} - + # 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃 + ./test_net_mod_socket --fun="start_reply" --key=100 & server_pid=$! && echo "pid: ${server_pid}" } function client() { - ./net_mod_socket client 5000 + + # ./test_net_mod_socket --fun="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" \ + --publist="localhost:5000" + + +} + +function msend() { + ./test_net_mod_socket --fun="test_net_sendandrecv_threads" \ + --sendlist="localhost:5000:100, localhost:5000:100" + +} + +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 "net_mod_socket"| awk '{print $2}' | xargs -i kill -9 {} ipcrm -a +} + +function scp() { + + scp -P 100 -rp ~/wk/softbus basic@192.168.5.22:/data/disk2/test + scp -rp ~/wk/softbus basic@192.168.20.10:/data3/workspace/wzq } case ${1} in @@ -30,6 +54,12 @@ "client") client ;; + "msend") + msend + ;; + "mpub") + mpub + ;; "close") close ;; @@ -38,6 +68,7 @@ server client ;; + *) echo "error input" exit 1 -- Gitblit v1.8.0