From: "James Edward Gray II" <james / grayproductions.net>
>
> The Socket/Server classes are very low level. GServer is more of a
> high-level approach but assumes Ruby's non-native threads are all you
> need for server IO and that's really only true in simple applications.
> Remember, a large write is all it takes to halt the entire Ruby
> process.
Just wanted to add that if you do roll your own,
sock.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK is available,
at least on the Unix platforms.
But indeed as has been discussed before, it'd be
***** OUTSTANDING ***** if ruby would just do
non-blocking I/O internally.
It seems even Windows sockets can be put into
non-blocking mode, via
ioctlsocket(sock, FIONBIO, ...)
I presume if it were utterly trivial for ruby to do
non-blocking I/O internally, it would have been done
long ago. I know too little about ruby's internals
to guess why it's (apparently) difficult. But it
would be very, very nice.
Regards,
Bill