ACUDPClient.listen() directly falls to error
Opened this issue · 0 comments
Hi,
I wanted to try just to see what kind of data it is possible to get from Ac Server.
I first installed your module from pip, and did not managed to make it work. Then, I got the repo from here seeing that you uploaded the 1.1.1 version.
But i'm still stuck for now, not managing to get clear data.
Here is what I found:
I just tried to run this code, from your examples:
from acudpclient.client import ACUDPClient
if __name__ == '__main__':
client = ACUDPClient(port=9600, remote_port=9601)
client.listen()
client.get_session_info()
while True:
event = client.get_next_event(call_subscribers=True)
print(event)
And a Windows error raises from client.py -> ACUDPClient.listen(), line 38:
def listen(self):
""" Setup the listening socket """
self.sock.bind(self.server_address)
self.sock.setblocking(0)
self.file = io.open(self.sock.fileno(), mode='rb', buffering=4096)
[WindowsError: [Error 6] The handle is invalid]
It seems like io.open() doesn't manage to do anything because the socket.fileno() returns a (int), not a stream or file-like object.
I saw that all the converting process you set up, form bytes, to readble data, is based on this file-like object structure... So it's kind of strange.
I'm running it on Win10, Python 3.9.4 (April 2021).
Do you have any idea of what to do, or if I did something wrong?
Edit - the next day :
I tested the same code on a Rpi 3B+, with Python 3.9.2 on it. And this problem does not appear. So I am concluding that the behaviour of the socket object is different depending on the os you run it on?
By the way, on windows and on raspbian, socket.socket.fileno()
returns an integer in both cases...
Edit - later in the week :
I tried to downgrade my Python version installed on windows tp 3.8.10, same problem than with the 3.9, tells me:
[WindowsError: [Error 6] The handle is invalid]