In message "[ruby-talk:8881] Re: About string return from IO::gets"
    on 01/01/09, "and.u" <is.r / com.is-andy.com> writes:
>So I think using io.gets is simple way. For some
>reason, I want to limit chars which are read actually.

The point is the reason.  If you would like to limit the
length *after* read whole of line, you can use substring
technic [ruby-talk:8866].  But if you would like to limit
the length to read from a socket, you have to use IO#read or
sysread.  Maybe sysread is needed to avoid blocking.

-- Gotoken