Commit 9fb142d1 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix receiver program.

parent ee4f00aa
......@@ -27,25 +27,22 @@ int main(int argc, char* const argv[]) {
sock = PrrtSocket_create(port, false);
check(sock != NULL, "Could not create socket.");
printf("SOCK: %d\n", sock->receiveDataThread);
int i = 1;
while(keepRunning) {
unsigned char buffer[MAX_PAYLOAD_LENGTH];
debug("about to recv");
int n = PrrtSocket_recv(sock, buffer);
debug("Done receiving");
if(n < 0 ) {
printf("n<0\n");
continue;
}
buffer[n] = '\0';
printf("[B (n: %3d, i: %3d)] %s", n, i, buffer);
//printf("[B (n: %3d, i: %3d)] %s", n, i, buffer);
i++;
usleep(1);
}
PrrtSocket_close(sock);
free(sock);
pthread_exit(NULL);
......
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