class IO::Endpoint::SocketEndpoint

This class doesn’t exert ownership over the specified socket, wraps a native ::IO.

def bind(&block)

@returns [Socket] The socket.
@parameter socket [Socket] The socket.
@yields {|socket| ...} If a block is given, yields the socket.
Bind using the wrapped socket.
def bind(&block)
	if block_given?
		yield @socket
	else
		return @socket
	end
end

def connect(&block)

@returns [Socket] The socket.
@parameter socket [Socket] The socket.
@yields {|socket| ...} If a block is given, yields the socket.
Connect using the wrapped socket.
def connect(&block)
	if block_given?
		yield @socket
	else
		return @socket
	end
end

def initialize(socket, **options)

@parameter options [Hash] Additional options to pass to the parent class.
@parameter socket [Socket] The socket to wrap.
Initialize a new socket endpoint.
def initialize(socket, **options)
	super(**options)
	
	@socket = socket
end

def inspect

@returns [String] A detailed string representation including the socket.
Get a detailed string representation of the socket endpoint.
def inspect
	"\#<#{self.class} #{@socket.inspect}>"
end

def to_s

@returns [String] A string representation showing the socket.
Get a string representation of the socket endpoint.
def to_s
	"socket:#{@socket}"
end