Commit 19aa93bc authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix eval test to work again.

parent 09af2d16
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -120,6 +120,17 @@ cdef extern from "proto/socket.h":
    bint PrrtSocket_set_sock_opt(PrrtSocket *sock_ptr, const_char *name, const uint32_t value)
    uint32_t PrrtSocket_get_sock_opt(PrrtSocket *sock_ptr, const_char *name)

cdef extern from "proto/timestamp.h":
    ctypedef struct PrrtTimestampTable:
        pass

    cdef enum PrrtTimestampPacketKind:
        ts_data_packet = 0,
        ts_any_packet = 0,
        ts_redundancy_packet = 1

    void PrrtTimestampTableInstall(PrrtSocket* sck, PrrtTimestampPacketKind kind, PrrtTimestampTable* tstp);

cdef extern from "util/bptree.h":
    ctypedef struct BPTreeNode:
        pass
+16 −0
Original line number Diff line number Diff line
from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t
from libc.stdlib cimport malloc, free

cimport cprrt

cdef extern from "proto/applicationConstraints.c":
    pass

cdef extern from "proto/timestamp.c":
    pass

cdef extern from "proto/stores/dataPacketStore.c":
    pass

@@ -67,10 +72,19 @@ cdef extern from "util/list.c":
cdef class PrrtSocket:
    cdef cprrt.PrrtSocket* _c_socket
    cdef bint isSender
    cdef cprrt.PrrtTimestampTable* tstable_data
    cdef cprrt.PrrtTimestampTable* tstable_redundancy

    def __cinit__(self, port, isSender):
        self._c_socket = cprrt.PrrtSocket_create(isSender)
        cprrt.PrrtSocket_bind(self._c_socket, "0.0.0.0", port)

        self.tstable_data       = <cprrt.PrrtTimestampTable*> malloc(sizeof(cprrt.PrrtTimestampTable))
        self.tstable_redundancy = <cprrt.PrrtTimestampTable*> malloc(sizeof(cprrt.PrrtTimestampTable))

        cprrt.PrrtTimestampTableInstall(self._c_socket, cprrt.ts_data_packet,       self.tstable_data)
        cprrt.PrrtTimestampTableInstall(self._c_socket, cprrt.ts_redundancy_packet, self.tstable_redundancy)

        self.isSender = isSender

    property target_delay:
@@ -102,3 +116,5 @@ cdef class PrrtSocket:
    def __dealloc__(self):
        if self._c_socket != NULL:
            cprrt.PrrtSocket_close(self._c_socket)
            free(self.tstable_data)
            free(self.tstable_redundancy)
+0 −2
Original line number Diff line number Diff line
@@ -54,8 +54,6 @@ class SenderThread(threading.Thread):
            self.sock.send(d)
            time.sleep(0.00001)

        self.sock.close()

class TestResults(object):
    def __init__(self):
        self.loss = 0