| 72 | } |
| 73 | |
| 74 | void HttpConnection::onDisconnected() { |
| 75 | if (mState == ConnectionState::CONNECTED || mState == ConnectionState::CONNECTING) { |
| 76 | // Check if we should attempt reconnection |
| 77 | // Use <= to handle the exact limit correctly (0-indexed attempts vs 1-indexed limit) |
| 78 | if (mConfig.maxReconnectAttempts == 0 || |
| 79 | mReconnectAttempts < mConfig.maxReconnectAttempts) { |
| 80 | transitionTo(ConnectionState::RECONNECTING, 0); |
| 81 | } else { |
| 82 | transitionTo(ConnectionState::DISCONNECTED, 0); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void HttpConnection::onError() { |
| 88 | // Treat errors the same as disconnection |
no outgoing calls
no test coverage detected