Hi,

I was actually strugling with irda_poll() last night, when writing a
fully asynchronous application (everything non-blocking). But I
haven't found any bugs for "read" selects. This works without
problems for me. It will only give read events when there is data to
be received. But wait a minute, it will actually give a read event
when the connection is established. This is probably wrong. It should
give a write event when the connection is established. It's probably
correct for incoming connections tho'. This will give you a read
event every time a connection have been established. It this the
problem? After that you should only get read events when there is
actually data to be read. That part must be correct since many
working applications would not work if this wasn't true.

But there _is_ a bug for "write" selects during connection
establishment. Select/poll will say that the socket is ready for
writing even if the connection haven't been fully established yet
(connect request, but no connect confirm). I'll probably make a fix
later today.

-- Dag

On Mon, 16 Apr 2001 15:27:09 -0700, Jean Tourrilhes wrote:
> Andrew Sutton wrote :
> > i'm working on a piece of code that selects between 2 sockets, one irda,
> > one inet.
> > 
> > sockIrDA = ...
> > sockInet = ...
> > sockMax = max( sockIrDA, sockInet ) + 1;
> > 
> > FD_ZERO( &fds );
> > FD_SET( sockIrDA, &fds );
> > FD_SET( sockInet, &fds );
> > select( sockMax, &fds, ... );
> > 
> > something like that. however, select always returns immediately and
> > always returns, reporting that the IrDA socket has data available to be
> > read:
> > 
> > FD_ISSET( sockIrDA, &fds ) == 1
> > 
> > anyway, i've been struggling to track down the cause for this - since
> > there just isn't any data available on the socket after it's been
> > accepted, but i don't really know how select ties into the irda kernel
> > module.
> > 
> > any help would be greatly appreciated... oh. i'm using 2.4.3 with irtty
> > and an esi dongle if that helps :)
> 
>       I have some select between various IrDA sockets in the
> e-Squirt code and it works like a charm. The selector is set only when
> data is available. I don't understand why having a Inet socket would
> be different.
>       First, make sure that you check the return value of the
> select. Common mistake.
>       Also, I never tested 2.4.3, there might be some unwelcomed
> changes in there. Ask Dag for the latest status.
>       Then, the code that deal with the select is irda_poll(). Just
> add a bunch of printk's to see what's happening...
>       Regards,
> 
>       Jean
> _______________________________________________
> Linux-IrDA mailing list  -  [EMAIL PROTECTED]
> http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda
> 
> 
> 
> 
-- 
Dag Brattli <[EMAIL PROTECTED]>
http://www.brattli.net/dag/
Try: Linux-IrDA, http://irda.sourceforge.net
Try: Pygmy, http://pygmy.sourceforge.net

_______________________________________________
Linux-IrDA mailing list  -  [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda

Reply via email to