wangzhengquan
2021-02-05 14c345b38d57fd814f217eb8465963a08ca79f7e
test_net_socket/net_mod_socket.sh
@@ -7,6 +7,8 @@
   # 打开请求应答测试的接受端
   ./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}"
}
# 交互式客户端
@@ -24,18 +26,20 @@
    
}
# 无限循环send
# 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="localhost:5000:100, localhost:5000:100"
    --sendlist=" :5000:100, :5000:101, :5000:102"
    
}
# 多线程send
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" \
@@ -47,6 +51,11 @@
   ./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() {
@@ -67,8 +76,8 @@
  "client")
    client
  ;;
  "msend")
   msend
  "one_to_many")
   one_to_many
  ;;
  "send")
   send