class Async::IO::SSLEndpoint

def bind

Returns:
  • (Socket) - the connected socket

Other tags:
    Yield: - the socket which is being connected
def bind
	if block_given?
		@endpoint.bind do |server|
			yield SSLServer.new(server, context)
		end
	else
		return SSLServer.new(@endpoint.bind, context)
	end
end

def connect(&block)

Returns:
  • (Socket) - the connected socket

Other tags:
    Yield: - the socket which is being connected
def connect(&block)
	SSLSocket.connect(@endpoint.connect, context, hostname, &block)
end

def context

def context
	if context = @options[:ssl_context]
		if params = self.params
			context = context.dup
			context.set_params(params)
		end
	else
		context = ::OpenSSL::SSL::SSLContext.new
		
		if params = self.params
			context.set_params(params)
		end
	end
	
	return context
end

def each

def each
	return to_enum unless block_given?
	
	@endpoint.each do |endpoint|
		yield self.class.new(endpoint, @options)
	end
end

def hostname

def hostname
	@options[:hostname] || @endpoint.hostname
end

def initialize(endpoint, **options)

def initialize(endpoint, **options)
	super(**options)
	
	@endpoint = endpoint
end

def params

def params
	@options[:ssl_params]
end

def to_s

def to_s
	"\#<#{self.class} #{@endpoint}>"
end