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

Method connect

src/fl/stl/asio/http/native_client.cpp.hpp:36–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool NativeHttpClient::connect() {
37 if (mConnection.getState() == ConnectionState::CLOSED) {
38 return false; // Permanently closed
39 }
40
41 // If already connected, return true
42 if (isConnected()) {
43 return true;
44 }
45
46 // Notify connection state machine
47 mConnection.connect();
48
49 // Attempt platform-specific connection
50 if (platformConnect()) {
51 mConnection.onConnected(0); // TODO: pass actual currentTimeMs
52 return true;
53 }
54
55 // Connection failed
56 mConnection.onDisconnected();
57 return false;
58}
59
60void NativeHttpClient::disconnect() {
61 if (mSocket.is_open()) {

Callers 1

platformConnectMethod · 0.45

Calls 3

onConnectedMethod · 0.80
onDisconnectedMethod · 0.80
getStateMethod · 0.45

Tested by

no test coverage detected