lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

> > Important note: a known bug in WinSock causes select to fail on
> > non-blocking TCP sockets. The function may return a socket as
> > writable even though the socket is not ready for sending.
>
> Surely this is true in general? You could not in general guarantee that
> a select()ed socket will not return EWOULDBLOCK unless you knew that
> the socket was never read/written except following the select();
> consequently, you should always be prepared for EWOULDBLOCK.

It's not true in general. You would expect to be able to write something
right after select returns telling you that you indeed can write
something.  Unfortunally, Windows' select "sometimes" returns the socket
as writable even when the send you call immediately after returns
EWOULDBLOCK. You would expect this to mean the connection was broken or
something, but it is their implementation that is broken. :)

Regards,
Diego.