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

Method update

src/fl/net/http/stream_transport.cpp.hpp:324–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324void HttpStreamTransport::update(u32 currentTimeMs) {
325 // Update connection state
326 mConnection.update(currentTimeMs);
327 bool nowConnected = isConnected();
328
329 // Handle state changes
330 if (mWasConnected != nowConnected) {
331 handleConnectionStateChange(currentTimeMs);
332 mWasConnected = nowConnected;
333 }
334
335 if (!isConnected()) {
336 // Attempt reconnection if needed
337 if (mConnection.shouldReconnect()) {
338 triggerReconnect();
339 }
340 return;
341 }
342
343 // Send heartbeat if needed
344 u32 timeSinceLastSent = currentTimeMs - mLastHeartbeatSent;
345 if (timeSinceLastSent >= mHeartbeatInterval) {
346 sendHeartbeat();
347 }
348
349 // Check for heartbeat timeout
350 checkHeartbeatTimeout(currentTimeMs);
351
352 // Process incoming data and drain messages (resolves promises)
353 processIncomingData();
354 parseChunkedMessages();
355}
356
357void HttpStreamTransport::setOnConnect(StateCallback callback) {
358 mOnConnect = callback;

Callers

nothing calls this directly

Calls 1

shouldReconnectMethod · 0.80

Tested by

no test coverage detected