Commit cb86c02e authored by StevenWdV's avatar StevenWdV

Removed TODOs. Changed poll_time_ms calculation.

parent 1fe35826
......@@ -119,8 +119,6 @@ class _RemoteInit:
self.window_size = window_size
# TODO more timeouts?
# TODO fast retransmit
class _Stream:
def __init__(self, binding: "Binding", local_port: int,
remote_port: int, remote_udp_addr: Any,
......@@ -247,7 +245,7 @@ class _Stream:
continue
else:
logging.warning(self.deb + "Unexpected SYN")
# TODO simultaneous open if self.first_recv_syn_nr is None
# (Would be simultaneous open if self.first_recv_syn_nr is None)
continue
if not self.__seq_between(packet.header.syn_nr, self.recv_ack_nr - self.local_window_size,
......@@ -608,7 +606,7 @@ class Binding:
self.local_udp_addr = local_udp_addr
self.window_size = window_size
self.timeout_sec = timeout_ms / 1000
self.poll_time_ms = poll_time_ms or timeout_ms / 2
self.poll_time_ms = poll_time_ms or min(25., timeout_ms / 4)
self.sock = socket.socket(protocol, socket.SOCK_DGRAM)
if local_udp_addr is not None:
......@@ -624,7 +622,6 @@ class Binding:
self.deb = f"{self.local_udp_addr}: "
logging.debug(self.deb + "Set up binding")
# TODO use more threads to avoid poll
def __background(self) -> None:
poller = select.poll() # Does not work on Windows because Python is stupid (WSAPoll is a thing)
poller.register(self.sock, select.POLLIN)
......
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