{
unsigned i;
int sock;
+ char buf[65536];
+
+ for (i = 0; i < 65536; ++i)
+ buf[i] = rand() & 0xff;
for (i = 0; i < 1000; ++i) {
unsigned src_num = (unsigned)(num_sources * gen_uniform_random());
fprintf(stderr, "connected\n");
- // FIXME: send data here
+ while (num_bytes > 0) {
+ unsigned bytes_to_send = num_bytes;
+ unsigned ret;
+
+ if (bytes_to_send > 65536) {
+ bytes_to_send = 65536;
+ }
+
+ ret = send(sock, buf, bytes_to_send, MSG_NOSIGNAL);
+ if (ret == -1) {
+ perror("send()");
+ exit(1);
+ }
+
+ num_bytes -= ret;
+ }
+ fprintf(stderr, "sent\n");
close(sock);
}