class Async::IO::SSLServer
We reimplement this from scratch because the native implementation doesn’t expose the underlying server/context that we need to implement non-blocking accept.
def accept(task: Task.current)
def accept(task: Task.current) peer, address = @server.accept wrapper = SSLSocket.new(peer, @context) return wrapper, address unless block_given? task.async do task.annotate "accepting secure connection #{address.inspect}" begin # You want to do this in a nested async task or you might suffer from head-of-line blocking. wrapper.accept yield wrapper, address rescue Async.logger.error(self) {$!} ensure wrapper.close end end end
def dup
def dup self.class.new(@server.dup, @context) end
def initialize(server, context)
def initialize(server, context) @server = server @context = context end
def listen(*args)
def listen(*args) @server.listen(*args) end