Commit 757273c9 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Slightly change sender and receiver for new tasks.

parent aeadb41b
......@@ -19,11 +19,13 @@ int main(int argc, char* const argv[]) {
return 0;
}
int i = 1;
while(1) {
unsigned char buffer[MAX_PAYLOAD_LENGTH];
int n = PrrtSocket_recv(&sock, buffer);
buffer[n] = '\0';
printf("[B (n: %d)] %s\n", n, buffer);
printf("[B (n: %d, i: %2d)] %s", n, i, buffer);
i++;
usleep(1);
}
......
......@@ -32,13 +32,12 @@ int main(int argc, char* const argv) {
FILE * fp;
char * line = NULL;
size_t len = 0;
ssize_t read;
fp = fopen("/opt/in.txt", "r");
if (fp == NULL)
exit(EXIT_FAILURE);
while ((read = getline(&line, &len, fp)) != -1) {
while ((getline(&line, &len, fp)) != -1) {
char buf[MAX_PAYLOAD_LENGTH];
sprintf(buf, line);
PrrtSocket_send(&sock, buf, strlen(buf));
......
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