• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

oga's tools


Commit MetaInfo

修訂c1b4f4a00f8a386d61097aafc96e21c207ca9bc0 (tree)
時間2016-01-19 06:13:09
作者oga <hyperoga@gmai...>
Commiteroga

Log Message

sutdown socket

Change Summary

差異

--- a/netpf_send.c
+++ b/netpf_send.c
@@ -72,10 +72,10 @@ char *b[];
7272
7373 for (i = 1; i<a; i++) {
7474 if (!strncmp(b[i],"-h",2)) {
75- printf("usage : netpf_send { -s | <hostname> } [-p <port(%d)>] [-c <send_size(KB)>\n", port);
75+ printf("usage : netpf_send { -s | <hostname> } [-p <port(%d)>] [-c <send_size(MB)>\n", port);
7676 printf(" -s : start as netpf server\n");
7777 printf(" hostnames : netpf server name.(start as netpf client)\n");
78- printf(" -c size : test data size(MB) default:%dMB\n", SEND_SIZE);
78+ printf(" -c size : test data size(MB) default:%dMB\n", SEND_SIZE/1024/1024);
7979 printf(" -p port : test port\n");
8080 exit(1);
8181 }
@@ -184,6 +184,7 @@ char *b[];
184184 //PUT_DATA(newsockfd, buf, SEND_SIZE);
185185 }
186186 printf("chile pid=%d exit!\n",getpid());
187+ shutdown (newsockfd, SHUT_RDWR);
187188 close(newsockfd);
188189 #ifndef DOS
189190 exit(0);
@@ -242,7 +243,7 @@ char *b[];
242243 //printf("## recv %d MB start\n",SEND_SIZE/1024/1024);
243244 //GET_DATA(sockfd, buf, SEND_SIZE);
244245 }
245- //shutdown (sockfd, SHUT_RDWR);
246+ shutdown (sockfd, SHUT_RDWR);
246247 close(sockfd);
247248
248249 }
@@ -281,10 +282,10 @@ void PUT_DATA(int sockfd, char *buf, int sz)
281282 if (diff <0 ) diff = -diff;
282283 dprintf("Send end usec : %u\n",wk2);
283284 dprintf(" diff usec : %u\n",diff);
284- printf("Send Size = %d time = %.6fsec perf = %dKB/sec\n",
285+ printf("Send Size = %d time = %.3fsec perf = %.3MB/sec\n",
285286 all,
286287 (float)diff/1000000,
287- (diff/1000 == 0)?999999:all/(diff/1000)); /* V1.02-C */
288+ (diff/1000 == 0)?999999:(float)all/diff); /* V1.02-C */
288289 }
289290
290291 /*
@@ -323,10 +324,10 @@ void GET_DATA(int sockfd, char *buf, int sz)
323324 if (diff <0 ) diff = -diff;
324325 dprintf("Recv end usec : %u\n",wk2);
325326 dprintf(" diff usec : %u\n",diff);
326- printf("Recv Size = %d time = %.6fsec perf = %dKB/sec\n",
327+ printf("Recv Size = %d time = %.3fsec perf = %.3fMB/sec\n",
327328 all,
328329 (float)diff/1000000,
329- all/(diff/1000));
330+ (float)all/diff);
330331 }
331332
332333 void reapchild()