Guillaume Marcais <guslist / free.fr> writes:

> So what made the socket suddenly buffered so that #recv becomes
> illegal? How can I check the buffered status of an IO? Can I revert it
> from buffered to unbuffered?

You should not mix buffered methods (read, write, puts, etc.) with
unbuffered methods (sysread, syswrite, recv, recvfrom, etc)

Alternatively, you can use the nonstdio library which redefines the
various buffered methods in terms of unbuffered methods so you can mix
the two kinds of IO access.

Note, though, buffered IO is intrinsically blocking operations. It
does not play nice with multiplexor like Kernel#select.

YS.