sin.sin_port = htons(port);
sin.sin_addr = destinations[dst_num];
- fprintf(stderr, "connecting %u\n", i);
-
if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
perror("connect()");
exit(1);
}
- fprintf(stderr, "connected\n");
-
while (num_bytes > 0) {
unsigned bytes_to_send = num_bytes;
unsigned ret;
char buf[65536];
unsigned long long bytes_received = 0;
- fprintf(stderr, "Receiver started\n");
-
for ( ;; ) {
int ret = read(sock, buf, 65536);
if (ret == 0)