Kamil Dudka wrote:
On Saturday 19 of September 2009 21:02:59 Peter Stuge wrote:
I have always understood select(2) (and later select_tut(2)) such
that if select() returns without error and FD_ISSET(socket,set) then
the corresponding io operation on socket can reliably be assumed to
not block, also when socket is in blocking mode.
That's indeed the case. Before the advent of multi-threading select()
was the common way of having one process serving multiple socket file
descriptors. Assume two TCP connections were served simultaneously,
how could a process call read() or recv() on the socket descriptor
without the risk of being blocked?
select() is one way to safely ensure that a subsequent read() or
write() (or recv() or send()) will not block.
I am not sure if such assumption holds in general.
Daniel says that the io operation can in fact block anyway, when the
socket is in blocking mode.
That should not happen and only can be due to a bug in either the
application or the Kernel in question.
Heiner
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel