Re: blocking/nonblocking socket and select -> usefull?



"David Schwartz" <davids@xxxxxxxxxxxxx> writes:
Oliver Kowalke wrote:
1) UDP socket - read: select invokes a function if a complete datagram
is available in the socket receivebuffer
-> read should not block

Unless the datagram is dropped before you call 'read', oops.

Linux documents this condition and claims that it can happen if the
checksum verification fails.

2) TCP socket - read: select invokes function if at least 1 byte is
available in the socket receivebuffer
-> read should not block

Unless it's later not available for some reason, oops.

While it is not technically forbidden by the specification to drop
already received data for some reason, I would consider this to be
'broken behaviour', at least for the general case.

Does somebody know if implementations that behave this way exist and
if, 'who they are'?
.