wangzhengquan
2021-02-02 cb85aa8a8d02a3d6dc16e3f32e78da9e70f9c7f5
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,12 +26,27 @@
    
}
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"
}
# 多线程pub
function mpub() {
   ./test_net_mod_socket --fun="test_net_pub_threads" \
    --publist="localhost:5000, localhost:5000"
@@ -53,12 +71,18 @@
  "client")
    client
  ;;
  "msend")
   msend
  "one_to_many")
   one_to_many
  ;;
  "send")
   send
  ;;
  "mpub")
   mpub
  ;;
  "pub")
   pub
  ;;
  "close")
    close
  ;;