def listen addresses = @addresses
    addresses = [nil] unless addresses

    listeners = 0

    addresses.each do |address|
      begin
        @server.listen address, @port
        @server.listeners[listeners..-1].each do |listener|
          host, port = listener.addr.values_at 2, 1
          host = "[#{host}]" if host =~ /:/ # we don't reverse lookup
          say "Server started at http://#{host}:#{port}"
        end

        listeners = @server.listeners.length
      rescue SystemCallError
        next
      end
    end

    if @server.listeners.empty? then
      say "Unable to start a server."
      say "Check for running servers or your --bind and --port arguments"
      terminate_interaction 1
    end
  end
#
Creates server sockets based on the addresses option.  If no addresses
were given a server socket for all interfaces is created.