4 static char *tcp_options="TCP_NODELAY IPTOS_THROUGHPUT";
6 static int bufsize=0x10000;
7 static char *host="127.0.0.1";
9 static void sender(void)
15 fd = open_socket_out(host, port);
17 if (fd == -1) exit(1);
19 set_socket_options(fd, tcp_options);
21 buf = (char *)malloc(bufsize);
24 fprintf(stderr,"out of memory\n");
28 memset(buf, 'Z', bufsize);
33 int ret = read(fd, buf, bufsize);
36 if (end_timer() > 2.0) {
45 static void usage(void)
47 printf("-p port\n-t socket options\n-H host\n-b bufsize\n\n");
50 int main(int argc, char *argv[])
55 while ((opt = getopt (argc, argv, "p:t:H:b:h")) != EOF) {
58 port = strtol(optarg, NULL, 0);
67 bufsize = strtol(optarg, NULL, 0);
77 printf("host=%s port=%d bufsize=%d options=[%s]\n", host, port, bufsize, tcp_options);