rhyst / linak-controller

A Python script to control Linak standing desks.
MIT License
355 stars 52 forks source link

TCP server gets stuck at await reader.read() #96

Open Reilley64 opened 2 months ago

Reilley64 commented 2 months ago

Whenever I try to send a command to the TCP server it get's stuck waiting for reader.read(). After waiting for a minute and then cancelling the request I get this in the log.

Traceback (most recent call last):
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 462, in finish_socket_func
    return ov.getresult()
           ^^^^^^^^^^^^^^
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\site-packages\linak_controller\main.py", line 123, in run_tcp_forwarded_command
    request = (await reader.read()).decode("utf8")
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\streams.py", line 706, in read
    block = await self.read(self._limit)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\streams.py", line 713, in read
    await self._wait_for_data('read')
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\streams.py", line 545, in _wait_for_data
    await self._waiter
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactor_events.py", line 286, in _loop_reading
    length = fut.result()
             ^^^^^^^^^^^^
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 803, in _poll
    value = callback(transferred, key, ov)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reill\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 466, in finish_socket_func
    raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer available