MCPcopy Create free account
hub / github.com/FastLED/FastLED / onConnected

Method onConnected

src/fl/stl/asio/http/connection.cpp.hpp:56–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void HttpConnection::onConnected(u32 currentTimeMs) {
57 if (mState == ConnectionState::CONNECTING || mState == ConnectionState::RECONNECTING) {
58 // Reset attempts if we were in RECONNECTING state before entering CONNECTING
59 // This detects successful reconnection after disconnect
60 bool shouldResetAttempts = mWasReconnecting || (mState == ConnectionState::RECONNECTING);
61
62 transitionTo(ConnectionState::CONNECTED, currentTimeMs);
63
64 if (shouldResetAttempts) {
65 resetReconnectAttempts(); // Successful reconnection, reset counter
66 } else {
67 resetReconnectState(); // Initial connection, just reset timing
68 }
69
70 mWasReconnecting = false;
71 }
72}
73
74void HttpConnection::onDisconnected() {
75 if (mState == ConnectionState::CONNECTED || mState == ConnectionState::CONNECTING) {

Callers 8

connectMethod · 0.80
connectMethod · 0.80
connectMethod · 0.80
acceptClientsMethod · 0.80
connectMethod · 0.80
FL_TEST_FILEFunction · 0.80
connectMethod · 0.80
connectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected