| | |
| | | function server() { |
| | | |
| | | |
| | | # 打开请求应答的接受端 |
| | | ./test_net_mod_socket --fun="start_reply" --key=11 & server_pid=$! && echo "pid: ${server_pid}" |
| | | |
| | | |
| | | # 开启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 client 5000 |
| | | |
| | | # ./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() { |
| | |
| | | "client") |
| | | client |
| | | ;; |
| | | "mclient") |
| | | close |
| | | server |
| | | mclient |
| | | ;; |
| | | "close") |
| | | close |
| | | ;; |
| | |
| | | server |
| | | client |
| | | ;; |
| | | |
| | | *) |
| | | echo "error input" |
| | | exit 1 |