Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Socket::Option.byte

Socket::Option.byte(family, level, optname, integer) => sockopt

Creates a new Socket::Option object which contains a byte as data.

Example
p Socket::Option.byte(:INET, :SOCKET, :KEEPALIVE, 1)
#=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
See also #byte .bool .int .ipv4_multicast_loop also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0