Commit 18c6899b authored by StevenWdV's avatar StevenWdV

Removed Windows stuff because it didn't work anyway

parent 5f5e7e2c
......@@ -632,23 +632,14 @@ class Binding:
break
self.stop_lock.release()
packet_batches: Dict[int, List[_AddrPacket]] = {}
self.sock.settimeout(self.poll_time_ms / 1000)
no_more_data = False
while not no_more_data:
try:
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
break
except (socket.timeout, BlockingIOError):
no_more_data = True
break
except OSError as err:
# WSAEOPNOTSUPP; see https://stackoverflow.com/q/34242622/4454665
# (not that this script seems to work on Windows anyway; no idea why it doesn't)
if err.errno != 10045:
raise
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
except (socket.timeout, BlockingIOError):
no_more_data = True
packet_batches: Dict[int, List[_AddrPacket]] = {}
self.sockets_lock.acquire()
while not no_more_data:
......@@ -670,20 +661,10 @@ class Binding:
logging.warning(self.deb + "Unknown server")
self.sock.settimeout(0)
while not no_more_data:
try:
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
break
except (socket.timeout, BlockingIOError):
no_more_data = True
break
except OSError as err:
# WSAEOPNOTSUPP; see https://stackoverflow.com/q/34242622/4454665
# (not that this script seems to work on Windows anyway; no idea why it doesn't)
if err.errno != 10045:
raise
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
except (socket.timeout, BlockingIOError):
no_more_data = True
for local_port, packets in packet_batches.items():
# noinspection PyProtectedMember
......
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