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. 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.
> 

i'm so worried about the write select stuff. i'm not using it right now
:)

here's how inet works:

        - when a connection has been completed, select reports a socket
available for writing (so you know you can use the socket).
        - when a connection request is present, select reports a socket
available for reading (so you know you can call accept).
        - when data is available to be read, select reports a socket available
for reading (so you know you can call recv).
        - when the socket is capable of sending data, select reports the socket
available for writing (this is almost always the case after a connection
has been established).
        - when the remote socket has been closed, select should report the
socket available for reading, but a subsequent call to recv() should
return 0 bytes, indicating closure. this is a little different from the
way af_irda used to work (it used to return -ECONNRESET on a remote
closure). i can't remember if this has been changed.

hope that helps. thanks,

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

Reply via email to