4 static char *tcp_options="";
6 static int bufsize=8192;
9 static void sender(void)
14 fd = open_socket_out(host, port);
16 set_socket_options(fd, tcp_options);
18 buf = (char *)malloc(bufsize);
21 fprintf(stderr,"out of memory\n");
25 memset(buf, 'Z', bufsize);
30 int ret = read(fd, buf, bufsize);
33 if (end_timer() > 2.0) {
35 printf("%g MB\n", total*1.0e-6);
43 static void usage(void)
45 printf("-p port\n-t socket options\n-H host\n-b bufsize\n\n");
48 int main(int argc, char *argv[])
53 while ((opt = getopt (argc, argv, "p:t:H:b:h")) != EOF) {
65 bufsize = atoi(optarg);
75 printf("host=%s port=%d options=[%s]\n", host, port, tcp_options);