wangzhengquan
2020-11-27 b5fe7f9a3bcc2f20d127f9081c1cf132091f6a57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function server() {
    
# 开启bus 
 ./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}" 
 
 
# 打开请求应答测试的接受端
    ./test_net_mod_socket --fun="start_reply" --key=11 & server_pid=$! &&  echo "pid: ${server_pid}" 
}
 
function client() {
 
    # ./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:11" \
     --publist="localhost:5000:8"  
 
     
}
 
function mclient() {
    ./test_net_mod_socket --fun="start_net_mclient" \
     --sendlist="localhost:5000:11"
     
}
 
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 {}
    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
  "server")
    close
  server
  ;;
  "client")
     client
  ;;
  "mclient")
    
    mclient
  ;;
  "close")
     close
  ;;
  "")
    close
    server 
    client
  ;;
 
  *)
  echo "error input"
  exit 1
  ;;
esac