class Async::IO::SocketEndpoint
This class doesn’t exert ownership over the specified socket, wraps a native ::IO.
def bind(&block)
def bind(&block) if block_given? begin yield @socket ensure @socket.reactor = nil end else return @socket end end
def connect(&block)
def connect(&block) if block_given? begin yield @socket ensure @socket.reactor = nil end else return @socket end end
def initialize(socket, **options)
def initialize(socket, **options) super(**options) # This socket should already be in the required state. @socket = Async::IO.try_convert(socket) end
def to_s
def to_s "\#<#{self.class} #{@socket.inspect}>" end