feedback_receiver.c 464 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <string.h>
#include <unistd.h>
#include "feedback_receiver.h"
#include "../defines.h"
#include "socket.h"

void *receive_feedback_loop(void *ptr) {
    char bufin[MAX_PAYLOAD_LENGTH];

    prrt_socket *sock_ptr = ptr;

    while(1) {
        memset(bufin, 0, MAX_PAYLOAD_LENGTH);
        prrt_packet *t = prrt_recv_feedback(sock_ptr, bufin, MAX_PAYLOAD_LENGTH);
        if(t != NULL) {
            delete_packet(t);
        }
        usleep(1000);
    }
}