Timeout and abort irp
Hi folks, I'm a bit annoyed that I just can't abort irp when timeout has a big value (or you must may for all timeout to be exceeded, without speaking of the 0 case).
I think IRP model misses a irp.cancel() method.
What do you think ? Though it might not be the right place to talk about this, I probably shall complain onto javax.usb project page ... Cheers, Topaz.
Currently the javax.usb implementation of usb4java uses synchronous transfers of libusb which can't be canceled because the thread is blocked by libusb. In future versions we should use asynchronous transfers which will be available in the low-level API of the upcoming 1.2.0 version. libusb provides a cancel function for asynchronous transfers so hopefully this will fix this issue. But unfortunately I can't tell you when this will be implemented.
One minor update: In 1.2.0 bulk-in and interrupt-in transfers will now block indefinitely without setting the timeout to 0 but still check for pipe-abortion after each timeout interval. So there should be no reason anymore to set the timeout to 0 and the blocked synchronous (and asynchronous) transfers will be aborted a few seconds after aborting the pipe (Timeout now defaults to 5 seconds).
Because of lack of time and knowledge I'm open for pull requests for this issue.