On Mon, Apr 16, 2001 at 11:41:39PM -0700, Dag Brattli wrote:
> 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.
Ok, I start to understand. I did ever try only "read" select
on server sockets, because my server is waiting for incomming
requests.
> 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'.
I never bothered to actually check the detail of that. You are
right, we may want to not give a read event at connection but wait for
actual data, no need to make the app works for nothing.
Even on incomming sockets, if the other end (client) doesn't
push any data but wait for data from the server, this behaviour is
probably not correct.
> 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.
Ok, and what happen on a non-server socket (a socket where no
bind has been done) ?
I guess that the network layer initialise sk->receive_queue ?
> 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.
Yes, look like it. Good catch !
Andrew : were you passing the fds as both read and write
arguments of the select ? That would explain...
Jean
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda