From a38304f7f6b91aaa1b0aa76cc9d3e5b6aef1f85f Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期六, 13 三月 2021 17:07:22 +0800
Subject: [PATCH] update
---
test_net_socket/net_mod_socket.sh | 85 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 75 insertions(+), 10 deletions(-)
diff --git a/test_net_socket/net_mod_socket.sh b/test_net_socket/net_mod_socket.sh
index 1eecd98..d8cf241 100755
--- a/test_net_socket/net_mod_socket.sh
+++ b/test_net_socket/net_mod_socket.sh
@@ -1,23 +1,74 @@
function server() {
- ipcrm -a
- ./dgram_mod_req_rep server 11 &
- ./dgram_mod_req_rep server 12 &
- ./dgram_mod_req_rep server 13 &
+ # 寮�鍚痓us
+ ./shm_util start_bus_server & server_pid=$! && echo "pid: ${server_pid}"
+ # 寮�鍚綉缁滆浆鍙戜唬鐞�
+ ./shm_util start_net_proxy --port=5000 & server_pid=$! && echo "pid: ${server_pid}"
- ./dgram_mod_bus server 8 &
+ # 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃
+ ./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}"
- ./net_mod_socket server 5000 &
-
+ # 鎵撳紑鍥為槦鍒楁敹杩涚▼
+ ./shm_util start_resycle & server_pid=$! && echo "pid: ${server_pid}"
}
+# 浜や簰寮忓鎴风
function client() {
- ./net_mod_socket client 5000
+ # ./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"
+
+
+ ./shm_util start_net_client \
+ --sendlist=" :5000:100" \
+ --publist="localhost:5000"
+
+
+}
+
+# one_to_many send
+function one_to_many() {
+ ./shm_util one_sendto_many \
+ --sendlist=" :5000:100, :5000:101, :5000:102"
+
+}
+
+#
+function send() {
+ ./shm_util test_net_sendandrecv \
+ --sendlist=" :5000:100, :5000:101, :5000:102"
+
+}
+
+# 鏃犻檺寰幆 pub
+function pub() {
+ ./shm_util test_net_pub \
+ --publist="localhost:5000, localhost:5000"
+
+}
+# 澶氱嚎绋媝ub
+function mpub() {
+ ./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 "dgram_mod_req_rep" -e "net_mod_socket" -e "dgram_mod_bus" | 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
+}
+
+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
@@ -27,16 +78,30 @@
"client")
client
;;
+ "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