SeanPesce/Spade-Web-Viewer

[WinError 10040] A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself

Opened this issue · 0 comments

On some (all?) Python versions for Windows, the following error occurs when the mirror tool attempts to read UDP data from the socket:

Traceback (most recent call last):
  File ".\spade_mirror.py", line 497, in <module>
    print(f'Server battery at {client.battery}%')
  File ".\spade_mirror.py", line 444, in battery
    response = self.send_command(msg)
  File ".\spade_mirror.py", line 423, in send_command
    self.connect()
  File ".\spade_mirror.py", line 261, in connect
    response = self.send_command(msg, True)
  File ".\spade_mirror.py", line 431, in send_command
    response, server = self.command_sock.recvfrom(msg.sizeof())
OSError: [WinError 10040] A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself

I'll have to wrap the recvfrom call to fix this.