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

Method connect

src/fl/net/http/stream_client.cpp.hpp:34–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34bool HttpStreamClient::connect() {
35 // If already connected, return true
36 if (isConnected()) {
37 return true;
38 }
39
40 // Reset HTTP state
41 mHttpHeaderSent = false;
42 mHttpHeaderReceived = false;
43
44 // Connect native socket
45 if (!mNativeClient->connect()) {
46 return false;
47 }
48
49 // Send HTTP POST request header
50 if (!sendHttpRequestHeader()) {
51 mNativeClient->disconnect();
52 return false;
53 }
54
55 // Read HTTP response header
56 if (!readHttpResponseHeader()) {
57 mNativeClient->disconnect();
58 return false;
59 }
60
61 // Mark connection as established in base class
62 mConnection.onConnected();
63
64 return true;
65}
66
67void HttpStreamClient::disconnect() {
68 if (mNativeClient) {

Callers

nothing calls this directly

Calls 2

onConnectedMethod · 0.80
disconnectMethod · 0.45

Tested by

no test coverage detected