jath03 / openrgb-python

A python client for the OpenRGB SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random hangs on client connect

olesk75 opened this issue · comments

Hi - nice project! Started playing around with it today and found something a bit odd:
4 out of 5 times (more or less), it works perfectly
Every 1 in 5 or so, it gets stuck trying to connect. The client shows up on the server, and if I interrupt it with CTRL-C, I get

client = OpenRGBClient('10.0.0.99', 6742, 'Python client')
  File "/home/olesk/venvs/rgb_controller/lib/python3.8/site-packages/openrgb/orgb.py", line 236, in __init__
    sleep(.2)
KeyboardInterrupt

It seems it gets stuck on device detection:

while any((dev is None for dev in self.devices)):
            sleep(.2)

This might be an upstream/server problem, but I thought I should report. I'll try the slightly more bleeding edge package and see if I get the same problem. I'm testing is WSL (Ubuntu) for Windows 10 for the record.

Same on https://github.com/jath03/openrgb-python#egg=openrgb-python, but they have same version number sooo... 😉
Perhaps a timeout would be a good idea. If it's a problem with the server, a timeout would at least allow for an attempt at reconnect - just my 2c

update: it seems to only happen when being run via WSL. When run directly in Windows 10, the hangs do not occur. I'm guessing it's some weird WSL/Windows routing issue, so I'd not recommend wasting any time on it.