Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

BasicSocket#recvmsg_nonblock

basicsocket.recvmsg_nonblock(maxdatalen=nil, flags=0, maxcontrollen=nil, opts={}) => [data, sender_addrinfo, rflags, *controls]

recvmsg receives a message using recvmsg(2) system call in non-blocking manner.

It is similar to BasicSocket#recvmsg but non-blocking flag is set before the system call and it doesn’t retry the system call.

By specifying a keyword argument exception to false, you can indicate that recvmsg_nonblock should not raise an IO::WaitReadable exception, but return the symbol :wait_readable instead.

See also #recvmsg #recv_nonblock #recv #remote_address also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0