Method: TCPSocket#read_nonblock
- Defined in:
- lib/polyphony/extensions/socket.rb
#read_nonblock(maxlen, buf = nil, exception: true) ⇒ String, :wait_readable
Performs a non-blocking read from the socket of up to maxlen bytes. If
buf is given, it is used as the read buffer, otherwise a new string will
be allocated. If the socket is not ready for reading and exception is
true, an IO::WaitReadable will be raised. If the socket is not ready for
reading and exception is false, :wait_readable is returned.
426 427 428 |
# File 'lib/polyphony/extensions/socket.rb', line 426 def read_nonblock(maxlen, buf = nil, exception: true) @io.read_nonblock(maxlen, buf, exception:) end |