async listen() {
    let address
    await new Promise((resolve, reject) => {
      this.#server.listen(0, '127.0.0.1', (err) => {
        if (err) {
          return reject(err)
        }
        address = this.#server.address()
        resolve()
      })
    })

    this.#address = address

    // Add handlers for the required agent startup connections. These should
    // be overwritten by tests that exercise the startup phase, but adding these
    // stubs makes it easier to test other connection events.
    this.addHandler(helper.generateCollectorPath('preconnect', this.#runId), this.preconnectHandler)
    this.addHandler(helper.generateCollectorPath('connect', this.#runId), this.connectHandler)
    this.addHandler(
      helper.generateCollectorPath('agent_settings', this.#runId),
      this.agentSettingsHandler
    )

    return address
  }
Start the server listening for requests.

@returns {Promise<object>} Returns a standard server address object.