| 149 | } |
| 150 | |
| 151 | bool HttpConnection::isTimedOut(u32 currentTimeMs) const { |
| 152 | if (mState != ConnectionState::CONNECTED) { |
| 153 | return false; // Only check timeout when connected |
| 154 | } |
| 155 | |
| 156 | // Check if enough time has passed since last data received |
| 157 | u32 timeSinceLastData = currentTimeMs - mLastDataReceivedMs; |
| 158 | return timeSinceLastData >= mConfig.connectionTimeoutMs; |
| 159 | } |
| 160 | |
| 161 | void HttpConnection::transitionTo(ConnectionState newState, u32 currentTimeMs) { |
| 162 | mState = newState; |