# File lib/cool.io/server.rb, line 12
    def initialize(listen_socket, klass = Socket, *args, &block)
      # Ensure the provided class responds to attach
      unless klass.allocate.is_a? IO
        raise ArgumentError, "can't convert #{klass} to Coolio::IO"
      end

      # Verify the arity of the provided arguments
      arity = klass.instance_method(:initialize).arity
      expected = arity >= 0 ? arity : -(arity + 1)

      if (arity >= 0 and args.size + 1 != expected) or (arity < 0 and args.size + 1 < expected)
        raise ArgumentError, "wrong number of arguments for #{klass}#initialize (#{args.size+1} for #{expected})"
      end

      @klass, @args, @block = klass, args, block
      super(listen_socket)
    end