Skip to content

Commit

Permalink
Make socket blocking? Fix weird Windows error:
Browse files Browse the repository at this point in the history
BlockingIOError: [WinError 10035] A non-blocking socket operation could not be completed immediately
https://stackoverflow.com/a/34034428
  • Loading branch information
julianneswinoga committed Jan 1, 2024
1 parent c657fbb commit c5b8a80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flightgear_python/fg_if.py
Expand Up @@ -66,6 +66,7 @@ def connect_rx(self, fg_host: str, fg_port: int, rx_cb: rx_callback_type) -> Eve
except Exception as e:
raise FGConnectionError(f'Could not bind to {fg_rx_addr}: {e}')
self.fg_rx_sock.settimeout(self.rx_timeout_s)
self.fg_rx_sock.setblocking(True)
self.fg_rx_cb = rx_cb

return self.event_pipe
Expand Down

0 comments on commit c5b8a80

Please sign in to comment.