From 71c847e99c0ce99fae955b08c0aafecb0fb9bdd6 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期一, 18 一月 2021 11:55:33 +0800 Subject: [PATCH] Merge branch 'master' into dev --- test_net_socket/test_net_mod_socket.cpp | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test_net_socket/test_net_mod_socket.cpp b/test_net_socket/test_net_mod_socket.cpp index c5092e9..0b2afd6 100644 --- a/test_net_socket/test_net_mod_socket.cpp +++ b/test_net_socket/test_net_mod_socket.cpp @@ -2,7 +2,7 @@ #include "net_mod_socket_wrapper.h" #include "bus_server_socket_wrapper.h" -#include "shm_mm_wraper.h" +#include "shm_mm_wrapper.h" #include "usg_common.h" #include <getopt.h> @@ -187,7 +187,8 @@ if (fgets(content, MAXLINE, stdin) != NULL) { // 鏀跺埌娑堟伅鐨勮妭鐐瑰嵆浣挎病鏈夊搴旂殑淇℃伅锛� 涔熻鍥炲涓�涓〃绀烘棤鐨勬秷鎭�,鍚﹀垯浼氫竴鐩寸瓑寰� - n = net_mod_socket_sendandrecv(client, node_arr, node_arr_size, content, strlen(content), &recv_arr, &recv_arr_size); + // n = net_mod_socket_sendandrecv(client, node_arr, node_arr_size, content, strlen(content), &recv_arr, &recv_arr_size); + n = net_mod_socket_sendandrecv_timeout(client, node_arr, node_arr_size, content, strlen(content), &recv_arr, &recv_arr_size, 1000); printf(" %d nodes reply\n", n); for(i=0; i<recv_arr_size; i++) { printf("host:%s, port: %d, key:%d, content: %s\n", @@ -247,7 +248,7 @@ net_mod_recv_msg_t *recv_arr; int total = 0; - + void *client = net_mod_socket_open(); net_node_t *node_arr; int node_arr_size = parse_node_list(targ->nodelist, &node_arr); @@ -279,7 +280,7 @@ total += n; } fclose(fp); - + net_mod_socket_close(client); return (void *)total; } @@ -294,7 +295,7 @@ struct timeval start, end; long total = 0; - client = net_mod_socket_open(); + printf("寮�濮嬫祴璇�...\n"); gettimeofday(&start, NULL); for (i = 0; i < processors; i++) { @@ -319,7 +320,7 @@ long diffusec = difftime - diffsec*1000000; fprintf(stderr,"鍙戦�佹暟鐩�: %ld, 鐢ㄦ椂: (%ld sec %ld usec), 骞冲潎: %f\n", total, diffsec, diffusec, difftime/total ); // fflush(stdout); - net_mod_socket_close(client); + } -- Gitblit v1.8.0