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

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:
cprrt.PrrtSocket_bind(self._c_socket, "0.0.0.0", port)
self.isSender = isSender
@property
def target_delay(self):
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "targetdelay")
property target_delay:
@target_delay.setter
def target_delay(self, value):
cprrt.PrrtSocket_set_sock_opt(self._c_socket, "targetdelay", value)
def __get__(self):
if not self.isSender:
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):
cdef char buffer[65536]
......
......@@ -37,6 +37,7 @@ class SenderThread(threading.Thread):
def __init__(self, seqnoDigits, packetCount):
threading.Thread.__init__(self)
self.sock = prrt.PrrtSocket(7005, True)
self.sock.target_delay = 1000**3
self.packetCount = packetCount
self.seqnoDigits = seqnoDigits
......
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