unfoldedcircle/integration-home-assistant

Connection timeout configuration is used as request timeout

Closed this issue · 0 comments

While testing the HA server communication I've noticed that the Home Assistant WebSocket connection timeout configuration is used as request timeout. The TCP connection timeout is always using the default 5s. (This is the max time allowed to connect to remote host, including DNS name resolution).

For certain setups this could be an issue and not enough time to successfully connect. It might even be a reason for the reported TLS connection issues.

Tasks:

  • enhance configuration with a request timeout
  • the awc::Client setup in new_websocket_client requires an awc::Connector setup for the TCP connection timeout:
        awc::ClientBuilder::new()
            .timeout(request_timeout)
            .connector(awc::Connector::new().timeout(connection_timeout))
            .finish()