Loading prrt/cprrt.pxd +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading prrt/prrt.pyx +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 Loading Loading @@ -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: Loading Loading @@ -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) tests/perf/__init__.py +0 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
prrt/cprrt.pxd +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
prrt/prrt.pyx +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 Loading Loading @@ -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: Loading Loading @@ -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)
tests/perf/__init__.py +0 −2 Original line number Diff line number Diff line Loading @@ -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 Loading