Commit 27d574ef authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Target delay can be specified via Python API.

parent 90aeb210
Pipeline #834 failed with stages
in 58 seconds
...@@ -73,13 +73,17 @@ cdef class PrrtSocket: ...@@ -73,13 +73,17 @@ cdef class PrrtSocket:
cprrt.PrrtSocket_bind(self._c_socket, "0.0.0.0", port) cprrt.PrrtSocket_bind(self._c_socket, "0.0.0.0", port)
self.isSender = isSender self.isSender = isSender
@property property target_delay:
def target_delay(self):
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "targetdelay")
@target_delay.setter def __get__(self):
def target_delay(self, value): if not self.isSender:
cprrt.PrrtSocket_set_sock_opt(self._c_socket, "targetdelay", value) raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "targetdelay")
def __set__(self, value):
if not self.isSender:
raise Exception("Not a sender.")
cprrt.PrrtSocket_set_sock_opt(self._c_socket, "targetdelay", value)
def recv(self): def recv(self):
cdef char buffer[65536] cdef char buffer[65536]
......
...@@ -37,6 +37,7 @@ class SenderThread(threading.Thread): ...@@ -37,6 +37,7 @@ class SenderThread(threading.Thread):
def __init__(self, seqnoDigits, packetCount): def __init__(self, seqnoDigits, packetCount):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self.sock = prrt.PrrtSocket(7005, True) self.sock = prrt.PrrtSocket(7005, True)
self.sock.target_delay = 1000**3
self.packetCount = packetCount self.packetCount = packetCount
self.seqnoDigits = seqnoDigits self.seqnoDigits = seqnoDigits
......
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