Zitat von Bastien Nocera <[email protected]>:

> On Sat, 2010-03-06 at 16:44 +0100, Hendrik Sattler wrote:
>> Am Freitag 05 März 2010 19:33:08 schrieb Bastien Nocera:
>> > It should work, but it doesn't.
>>
>> Looking at the source of libusb, this is a bit messed up, there.
>> In os/linux_usb.c, the only add the FD for POLLOUT (forgetting   
>> POLLIN) and in
>> os/darwin_usb.c, the only add it for POLLIN (forgetting POLLOUT). Someone
>> should go upstream and fix that!
>> Current suggestion: the wanted fd is always the last fd in the pollfd list,
>> ignoring the events field. This will then also work with MacOS X.
>> And that's also why your POLLOUT fd worked (the other one are all POLLIN) on
>> Linux.
>
> Filed as:
> http://www.libusb.org/ticket/36

I am currently modularizing the transport code a bit more. There are  
then init() and cleanup() functions possible for each transport which  
can call libusb_init() and libusb_set_pollfd_notifiers(). Then, when  
opening the USB device handle, you get the right fd delivered to you.  
This is better than the current approach of walking the list manually.
Somehow, the libusb timeouts (whatever they talk about, there) must  
also be handled.

An alternative is to use libusb_handle_events_timeout() instead of  
calling select() for the fd. Seems to be similar with less surprises.  
But this will not support OBEX_GetFD(), then.

I'll prepare a patch for the first approach, tonight.

HS



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to