On 2012.06.18 11:50, Peter Stuge wrote:
>> This works as intended on OS X, but on Windows I only ever see 3
>> transfers complete
>
> If the later 13 were successfully submitted then that is a bug in the
> Windows backend.

Or rather, this is because OS-X has some pre-emptive implementation of 
hotplug, to be able to do so, which is a feature that libusb does not 
yet provide as a whole. Peter, please take a look at the Darwin code.

The actual bug is that libusb still does not globally support hotplug, 
as demonstrated with yet another issue where someone has a problem with 
an hotplug related scenario. This is getting old...

>> - is this an appropriate way to manage the process of closing my device?
>
> Yes, it is.

Or rather, it would be, if we had implemented global hotplug support, 
which we should (and could) have done years ago.

> I think this is an important addition to the API.

Indeed, hotplug support is.

>> - does this issue sound familiar to anybody?
>
> You are the first one to report it, but there have not been very many
> reports of libusb use on Windows at all, so that doesn't mean much.

Liam, I'm afraid you'll find that many people on these lists don't agree 
with these kind of subjective statements from Peter. This is actually 
one of the the reason the libusbx fork exists.

>> - any suggested workarounds?
>
> No workaround. :\ If the Windows backend accepts a transfer then it
> must also complete, regardless of whether the device is there or not.

Of course, by definition, doing so does requires some form of hotplug, 
either private or global...

> I hope Pete will also look into it in the context of the libusbx project

As the saying goes, you don't put the cart before the horse.

I think most people will agree that it makes little sense for each 
backend to do their own private implementation of hotplug, only to see 
it redone with the planned global hotplug implementation. And this is 
the reason why the Windows backend is not doing anything special there.

Maybe the OS-X backend didn't think global hotplug support would be 
implemented any time soon (which they were probably right about at the 
time), and thus they compensated for it by adding their own local 
implementation. But at least as far as libusbx is concerned, we do have 
plans to start looking into adding global hotplug support soon(ish), so 
it would seem unwise, in terms of effort, to duplicate that effort in a 
backend

Liam, I know this is probably not the answer you are looking for, but 
for now, I'd encourage you to follow what's occurring with the libusbx 
project, especially with regards to the planned development branch, as 
this is the place where you should first see support for device 
disconnection being added. But until that is done, you avoid relying on 
libusb(x) for any scenario that involves hot plugging of a device.

/Pete

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to