Method: TCPSocket#write_nonblock

Defined in:
lib/polyphony/extensions/socket.rb

#write_nonblock(buf, exception: true) ⇒ Integer, :wait_readable

Performs a non-blocking to the socket. If the socket is not ready for writing and exception is true, an IO::WaitWritable will be raised. If the socket is not ready for writing and exception is false, :wait_writable is returned.

Parameters:

  • buf (String, nil)

    write buffer

  • exception (bool) (defaults to: true)

    whether to raise an exception if not ready for reading

Returns:

  • (Integer, :wait_readable)

    number of bytes written



438
439
440
# File 'lib/polyphony/extensions/socket.rb', line 438

def write_nonblock(buf, exception: true)
  @io.write_nonblock(buf, exception:)
end