Closed bacarz closed 7 months ago
Good point. It can certainly be improved to use a selector. I am actually reworking that section of code, will keep that in mind. thanks
Want to try this branch? https://github.com/pylessard/python-udsoncan/tree/use-selector-in-socket-connection
Tested. Looks good.
@pylessard After adding the selectors in IsoTPSocketConnection, I think it won't work when using custom sockets that don't have a file descriptor, so events will always be None, and so self.rxqueue will always remain empty, which is the case for me.
Why would a socket have no file descriptor? Are you able to provide a reproducing code?
Closing IsoTPSocketConnection stucks on
self.rxthread.join()
whenself.tpsock
is created in blocking mode:rxthread_task
use directly socket.recv byself.tpsock.recv()
. Is it possible to use selector?Or it would be better to make some changes to
isotp.socket.recv
directly?