| 110 | } |
| 111 | |
| 112 | bool HttpConnection::shouldSendHeartbeat(u32 currentTimeMs) const { |
| 113 | if (mState != ConnectionState::CONNECTED) { |
| 114 | return false; // Only send heartbeats when connected |
| 115 | } |
| 116 | |
| 117 | // Check if enough time has passed since last heartbeat |
| 118 | u32 timeSinceLastHeartbeat = currentTimeMs - mLastHeartbeatSentMs; |
| 119 | return timeSinceLastHeartbeat >= mConfig.heartbeatIntervalMs; |
| 120 | } |
| 121 | |
| 122 | void HttpConnection::update(u32 currentTimeMs) { |
| 123 | // Check for timeout first (before updating timestamps) |
no outgoing calls
no test coverage detected