class IO::Endpoint::Wrapper

def accept(server, timeout: nil, linger: nil, **options, &block)

Bind to a local address and accept connections in a loop.
def accept(server, timeout: nil, linger: nil, **options, &block)
	while true
		socket, address = server.accept
		
		if linger
			socket.setsockopt(SOL_SOCKET, SO_LINGER, 1)
		end
		
		if timeout
			set_timeout(socket, timeout)
		end
		
		async do
			# Some sockets, notably SSL sockets, need application level negotiation before they are ready:
			if socket.respond_to?(:start)
				begin
					socket.start
				rescue
					socket.close
					raise
				end
			end
			
			yield socket, address
		end
	end
end