--===============7530193296573746555== Content-Type: multipart/alternative; boundary="0000000000001f9e1005ac552e90" --0000000000001f9e1005ac552e90 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Aug 8, 2020 at 4:13 AM Tim Roberts wrote: > On Aug 7, 2020, at 9:44 AM, Laszlo Papp wrote: > > > > I am trying to use libusb in a simple polling main function, but it > looks like the file descriptors are always getting POLLOUT in the revents > member of the structure even if an incoming message is being triggered, > i.e. for reading. Is this expected? Is there anything I am doing wrong? > > That=E2=80=99s the way it works. Timer timeouts and other special events= fire as > POLLIN, USB traffic is POLLOUT. You need to be handling the USB events i= n > order, so there=E2=80=99s no reason to have some bypass others. > Hi Tim, Thank you so much for your prompt reply. So, as I understand, this is expected behavior even for an input bulk endpoint? My confusion came from using poll earlier in serial port or ethernet (socket) context. We used to get POLLIN set by poll in the revents member when data was available for reading, not POLLOUT. So, usb works differently= ? > =E2=80=94 > Tim Roberts, timr@probo.com > Providenza & Boekelheide, Inc. > > > > _______________________________________________ > libusb-devel mailing list > libusb-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/libusb-devel > --0000000000001f9e1005ac552e90 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Aug 8, 2020 at 4:13 AM Tim Ro= berts <timr@probo.com> wrote:
On Aug 7, 2020, a= t 9:44 AM, Laszlo Papp <lpapp@kde.org> wrote:
>
> I am trying to use libusb in a simple polling main function, but it lo= oks like the file descriptors are always getting POLLOUT in the revents mem= ber of the structure even if an incoming message is being triggered, i.e. f= or reading. Is this expected? Is there anything I am doing wrong?

That=E2=80=99s the way it works.=C2=A0 Timer timeouts and other special eve= nts fire as POLLIN, USB traffic is POLLOUT.=C2=A0 You need to be handling t= he USB events in order, so there=E2=80=99s no reason to have some bypass ot= hers.

Hi Tim,

= Thank you so much for your prompt reply. So, as I understand, this is expec= ted behavior even for an input bulk endpoint?

My c= onfusion came from using poll earlier in serial port or ethernet (socket) c= ontext. We used to get POLLIN set by poll in the revents member when data w= as available for reading, not POLLOUT. So, usb works differently?
=C2=A0
=E2=80=94
Tim Roberts, timr@probo= .com
Providenza & Boekelheide, Inc.



_______________________________________________
libusb-devel mailing list
lib= usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listi= nfo/libusb-devel
--0000000000001f9e1005ac552e90-- --===============7530193296573746555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7530193296573746555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libusb-devel mailing list libusb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusb-devel --===============7530193296573746555==--