Resolve hostnames and reconnect

To properly connect to an entrypoint, encoders must be capable of performing DNS lookups to resolve the stream publishing URL hostname. Encoders must also do a DNS lookup when a connection is interrupted in order re-resolve the hostname and reconnect to an entrypoint. This re-resolving of the hostname must be done on any connection that is disrupted to ensure up-to-date DNS information is used when reconnecting. An encoder should not reuse a cached IP address from a previous DNS lookup for other bitrates of the same hostname that may also experience a disconnect. Each bitrate should re-resolve upon disconnect.

An entrypoint might get overloaded, go down for maintenance, or encounter bad connectivity. In such cases, the disconnect from the entrypoint triggers a failover to a new entrypoint capable of properly consuming the stream. The re-resolution of the hostname on disconnect makes this possible.

Resending onMetatdata is also required with the new connection.