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

Fix eval test to work again.

parent 09af2d16
Pipeline #950 passed with stages
in 1 minute and 7 seconds
......@@ -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
......
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)
......@@ -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
......
Markdown is supported
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