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,12 +73,16 @@ cdef class PrrtSocket:
cprrt.PrrtSocket_bind(self._c_socket, "", port)
self.isSender = isSender
def target_delay(self):
property target_delay:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_sock_opt(self._c_socket, "targetdelay")
def target_delay(self, value):
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):
......@@ -37,6 +37,7 @@ class SenderThread(threading.Thread):
def __init__(self, seqnoDigits, packetCount):
self.sock = prrt.PrrtSocket(7005, True)
self.sock.target_delay = 1000**3
self.packetCount = packetCount
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