mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
PullMessages is a long-poll: the camera holds the connection open for up to PullTimeout waiting for an event. http.Client.Timeout bounds the whole exchange — dial, write, wait-for-headers — and starts before the camera has parsed the request, so a client ceiling equal to or below PullTimeout expires first on every interval with no event. The failure mode is quiet and easy to misread. Pulls fail continuously, but the stream stays alive because ReconnectAfterFailures recreates the subscription, and each recreate makes the camera replay its full property state. Events keep arriving, in bursts, on the reconnect cadence rather than when they happen — so it reads as a slow camera rather than a misconfiguration. Observed in the field with both values at 5s: every pull timed out, recovery landed after exactly 3 failures, and ~90 property-state events were replayed every 18s. Validated in NewStream, before the subscription call, since the config can only fail. A zero client timeout stays legal — unbounded is safe because the pull loop is already bounded by ctx.