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) {
42 static void usage(void)
44 printf("-p port\n-t socket options\n-H host\n-b bufsize\n\n");
47 int main(int argc, char *argv[])
52 while ((opt = getopt (argc, argv, "p:t:H:b:h")) != EOF) {
64 bufsize = atoi(optarg);
74 printf("host=%s port=%d options=[%s]\n", host, port, tcp_options);