From b5ae34d4422399c5d5458d071cca8c9bc89d20bb Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期六, 20 二月 2021 16:27:02 +0800 Subject: [PATCH] status map for close --- test_net_socket/test_net_mod_socket.cpp | 194 ++++++++++++++++++++++++------------------------ 1 files changed, 98 insertions(+), 96 deletions(-) diff --git a/test_net_socket/test_net_mod_socket.cpp b/test_net_socket/test_net_mod_socket.cpp index c3538b0..ab46f31 100644 --- a/test_net_socket/test_net_mod_socket.cpp +++ b/test_net_socket/test_net_mod_socket.cpp @@ -527,102 +527,6 @@ } -int main(int argc, char *argv[]) { - shm_mm_wrapper_init(512); - - argument_t opt = parse_args(argc, argv); - - // port = atoi(argv[2]); - - if(opt.fun == NULL) { - usage(argv[0]); - exit(1); - } - - if (strcmp("start_net_proxy", opt.fun) == 0 ) { - if(opt.port == 0) { - usage(argv[0]); - exit(1); - } - start_net_proxy(opt); - - } - else if (strcmp("start_bus_server", opt.fun) == 0) { - - start_bus_server(opt); - } - else if (strcmp("start_reply", opt.fun) == 0) { - if(opt.key == 0) { - usage(argv[0]); - exit(1); - } - start_reply(opt.key); - } - else if (strcmp("start_net_client", opt.fun) == 0) { - if(opt.sendlist == 0) { - fprintf(stderr, "Missing sendlist .\n"); - usage(argv[0]); - exit(1); - } - if(opt.publist == 0) { - fprintf(stderr, "Missing publist.\n"); - usage(argv[0]); - exit(1); - } - start_net_client(opt.sendlist, opt.publist); - } - else if (strcmp("one_sendto_many", opt.fun) == 0) { - if(opt.sendlist == 0) { - fprintf(stderr, "Missing sendlist .\n"); - usage(argv[0]); - exit(1); - } - - one_sendto_many(opt.sendlist); - } - else if (strcmp("test_net_sendandrecv", opt.fun) == 0) { - if(opt.sendlist == 0) { - fprintf(stderr, "Missing sendlist .\n"); - usage(argv[0]); - exit(1); - } - - test_net_sendandrecv(opt.sendlist); - } - else if (strcmp("test_net_pub_threads", opt.fun) == 0) { - if(opt.publist == 0) { - fprintf(stderr, "Missing publist .\n"); - usage(argv[0]); - exit(1); - } - - test_net_pub_threads(opt.publist); - } - else if (strcmp("test_net_pub", opt.fun) == 0) { - if(opt.publist == 0) { - fprintf(stderr, "Missing publist .\n"); - usage(argv[0]); - exit(1); - } - - test_net_pub(opt.publist); - } - else if (strcmp("start_resycle", opt.fun) == 0) { - start_resycle(); - } - - else { - usage(argv[0]); - exit(1); - - } - - printf("==========end========\n"); - // shm_mm_wrapper_destroy(); - -} - - void usage(char *name) { @@ -799,3 +703,101 @@ } printf("============node list end==========\n"); } + + + + +int main(int argc, char *argv[]) { + shm_mm_wrapper_init(512); + + argument_t opt = parse_args(argc, argv); + + // port = atoi(argv[2]); + + if(opt.fun == NULL) { + usage(argv[0]); + exit(1); + } + + if (strcmp("start_net_proxy", opt.fun) == 0 ) { + if(opt.port == 0) { + usage(argv[0]); + exit(1); + } + start_net_proxy(opt); + + } + else if (strcmp("start_bus_server", opt.fun) == 0) { + + start_bus_server(opt); + } + else if (strcmp("start_reply", opt.fun) == 0) { + if(opt.key == 0) { + usage(argv[0]); + exit(1); + } + start_reply(opt.key); + } + else if (strcmp("start_net_client", opt.fun) == 0) { + if(opt.sendlist == 0) { + fprintf(stderr, "Missing sendlist .\n"); + usage(argv[0]); + exit(1); + } + if(opt.publist == 0) { + fprintf(stderr, "Missing publist.\n"); + usage(argv[0]); + exit(1); + } + start_net_client(opt.sendlist, opt.publist); + } + else if (strcmp("one_sendto_many", opt.fun) == 0) { + if(opt.sendlist == 0) { + fprintf(stderr, "Missing sendlist .\n"); + usage(argv[0]); + exit(1); + } + + one_sendto_many(opt.sendlist); + } + else if (strcmp("test_net_sendandrecv", opt.fun) == 0) { + if(opt.sendlist == 0) { + fprintf(stderr, "Missing sendlist .\n"); + usage(argv[0]); + exit(1); + } + + test_net_sendandrecv(opt.sendlist); + } + else if (strcmp("test_net_pub_threads", opt.fun) == 0) { + if(opt.publist == 0) { + fprintf(stderr, "Missing publist .\n"); + usage(argv[0]); + exit(1); + } + + test_net_pub_threads(opt.publist); + } + else if (strcmp("test_net_pub", opt.fun) == 0) { + if(opt.publist == 0) { + fprintf(stderr, "Missing publist .\n"); + usage(argv[0]); + exit(1); + } + + test_net_pub(opt.publist); + } + else if (strcmp("start_resycle", opt.fun) == 0) { + start_resycle(); + } + + else { + usage(argv[0]); + exit(1); + + } + + printf("==========end========\n"); + // shm_mm_wrapper_destroy(); + +} -- Gitblit v1.8.0