From 14c345b38d57fd814f217eb8465963a08ca79f7e Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期五, 05 二月 2021 17:41:09 +0800
Subject: [PATCH] update

---
 test_net_socket/net_mod_socket.sh |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/test_net_socket/net_mod_socket.sh b/test_net_socket/net_mod_socket.sh
index cd4c809..288f192 100755
--- a/test_net_socket/net_mod_socket.sh
+++ b/test_net_socket/net_mod_socket.sh
@@ -7,8 +7,11 @@
 
 	# 鎵撳紑璇锋眰搴旂瓟娴嬭瘯鐨勬帴鍙楃
 	./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" \
@@ -23,20 +26,40 @@
 	 
 }
 
-function msend() {
-	./test_net_mod_socket --fun="test_net_sendandrecv_threads" \
-	 --sendlist="localhost:5000:100, localhost:5000:100"
+# 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 stop() {
+	ps -ef | grep -e "test_net_mod_socket" -e "heart_beat"| awk  '{print $2}' | xargs -i kill -15 {}
+	
+}
+
 function close() {
-	ps -ef | grep -e "test_net_mod_socket" -e "net_mod_socket"| 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
 }
 
@@ -48,19 +71,23 @@
 
 case ${1} in
   "server")
-	close
-	sleep 2
   server
   ;;
   "client")
  	client
   ;;
-  "msend")
-	msend
+  "one_to_many")
+	one_to_many
+  ;;
+  "send")
+	send
   ;;
   "mpub")
 	mpub
   ;;
+  "pub")
+	pub
+  ;;
   "close")
  	close
   ;;

--
Gitblit v1.8.0