Re: select for UNIX sockets?

Krzysztof Halasa
2003-06-11T21:43:39Z

Jesse Pollard <jesse@cats-chateau.net> writes:

> As in: ALWAYS ready to write as soon as a connection is made. It can
> still block on a write if the amount to write is larger than the buffer
> available. Nothing is said about the AMOUNT that can be written
> (though with most FIFOs/pipes the limit is ~ 4K, though not guaranteed
> since other writers may fill it between the poll and the write.

Still, it is local (UNIX) datagram socket and thus the number of
datagrams is the limit, not the number of bytes. And yes, the problem
is present with 1-byte datagrams. And still, the problem is with select()
and not with send*().

It is *not* FIFO/pipe/stream socket etc. And not a UDP/IP socket either.

> A file descriptor for a socket that is listening for connec-
> tions will indicate that it is ready for reading, when con-
> nections are available. A file descriptor for a socket that
> is connecting asynchronously will indicate that it is ready
> for writing, when a connection has been established.
>
> as in "READY for writing", not that it won't block when you DO write.
>
> (Also "READY for reading", not that it won't block when you DO read.)

I think the above covers only stream-based connection establishing.

> You've been lucky to have relatively idle systems or large memory
> systems.
>
> I suspect you actually were blocking, just not for very long.

No. It is just something completely different.

I understand a system can have no such support. But, currently, Linux
has support which is broken.
--
Krzysztof Halasa
Network Administrator