Commit fd5b00ca authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix sender program.

parent 9fb142d1
......@@ -28,31 +28,18 @@ int main(int argc, char *const argv) {
debug("SENDING\n");
FILE *fp;
char *line = NULL;
size_t len = 0;
int j = 0;
int rounds = 10;
uint32_t j = 0;
int rounds = 65536;
while(j < rounds) {
fp = fopen("/opt/in.txt", "r");
if (fp == NULL)
exit(EXIT_FAILURE);
while ((getline(&line, &len, fp)) != -1) {
char buf[MAX_PAYLOAD_LENGTH];
sprintf(buf, "%s", line);
PrrtSocket_send(socket, buf, strlen(buf));
}
char buf[MAX_PAYLOAD_LENGTH];
sprintf(buf, "%10d", j);
PrrtSocket_send(socket, buf, strlen(buf));
fclose(fp);
j++;
usleep(1);
}
if (line)
free(line);
usleep(1000*1000*10);
PrrtSocket_close(socket);
free(socket);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment