Commit d2c9846d authored by StevenWdV's avatar StevenWdV

Made it work on Windows after all after removing the socket.MSG_WAITALL flag...

parent 731238b2
......@@ -635,7 +635,10 @@ class Binding:
self.sock.settimeout(self.poll_time_ms / 1000)
no_more_data = False
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
data, addr = self.sock.recvfrom(header_size + payload_size)
while len(data) < header_size + payload_size:
self.sock.settimeout(None)
data += self.sock.recv(header_size + payload_size - len(data))
except (socket.timeout, BlockingIOError):
no_more_data = True
......@@ -662,10 +665,14 @@ class Binding:
self.sock.settimeout(0)
try:
data, addr = self.sock.recvfrom(header_size + payload_size, socket.MSG_WAITALL)
data, addr = self.sock.recvfrom(header_size + payload_size)
while len(data) < header_size + payload_size:
self.sock.settimeout(None)
data += self.sock.recv(header_size + payload_size - len(data))
except (socket.timeout, BlockingIOError):
no_more_data = True
self.sock.settimeout(None)
for local_port, packets in packet_batches.items():
# noinspection PyProtectedMember
self.sockets[local_port]._pass_received_msgs(packets)
......
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