From 0d98f1227110082e9e507ca236458f6c363e25b6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Mon, 29 May 1995 13:46:40 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'RELENG_2_0_5_ALPHA'. --- benchmarks/tcpblast/src/tcpblast.c | 116 ------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 benchmarks/tcpblast/src/tcpblast.c (limited to 'benchmarks/tcpblast/src/tcpblast.c') diff --git a/benchmarks/tcpblast/src/tcpblast.c b/benchmarks/tcpblast/src/tcpblast.c deleted file mode 100644 index 3b8a914e1c4d..000000000000 --- a/benchmarks/tcpblast/src/tcpblast.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * tcpblast - test and estimate TCP thruput - * - * Daniel Karrenberg - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#define BLKSIZE 1024 - -struct sockaddr_in sock_in; -struct servent *sp; -struct hostent *host; - -long starts, startms, stops, stopms, expms; -struct timeval ti; -struct timezone tiz; - -char greet[BLKSIZE] = "Hi!"; -int nblocks; -int f; - -int main(argc, argv) -int argc; char **argv; -{ - register int i; - - if (argc!=3) - { - fprintf(stderr, "usage: tcpblast destination nblkocks\n"); - fprintf(stderr, "blocksize: %d bytes\n", BLKSIZE); - exit(1); - } - - nblocks = atoi(argv[2]); - if (nblocks<=1 || nblocks>=10000) - { - fprintf(stderr, "tcpblast: 1 < nblocks <= 10000 \n"); - exit(1); - } - - bzero((char *)&sock_in, sizeof (sock_in)); - sock_in.sin_family = AF_INET; - f = socket(AF_INET, SOCK_STREAM, 0); - if (f < 0) { - perror("tcpblast: socket"); - exit(3); - } - if (bind(f, (struct sockaddr*) &sock_in, sizeof (sock_in)) < 0) { - perror("tcpblast: bind"); - exit(1); - } - - host = gethostbyname(argv[1]); - if (host) { - sock_in.sin_family = host->h_addrtype; - bcopy(host->h_addr, &sock_in.sin_addr, host->h_length); - } else { - sock_in.sin_family = AF_INET; - sock_in.sin_addr.s_addr = inet_addr(argv[1]); - if (sock_in.sin_addr.s_addr == -1) { - fprintf(stderr, "tcpblast: %s unknown host\n", argv[1]); - exit(1); - } - } - sock_in.sin_port = htons(9); - - if (connect(f, (struct sockaddr*) &sock_in, sizeof(sock_in)) <0) - { - perror("tcpblast connect:"); - exit(1); - } - - if (gettimeofday(&ti, &tiz) < 0) - { - perror("tcpblast time:"); - exit(1); - } - starts = ti.tv_sec; - startms = ti.tv_usec / 1000L; - - - for (i=0; i