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

Method send

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

Source from the content-addressed store, hash-verified

78}
79
80int NativeHttpClient::send(fl::span<const u8> data) {
81 if (!isConnected() || !mSocket.is_open()) {
82 return -1;
83 }
84
85 asio::error_code ec;
86 size_t n = mSocket.write_some(data, ec);
87
88 if (ec) {
89 if (ec.code == asio::errc::would_block) {
90 return 0;
91 }
92 mConnection.onDisconnected();
93 return -1;
94 }
95
96 return static_cast<int>(n);
97}
98
99int NativeHttpClient::recv(fl::span<u8> buffer) {
100 if (!isConnected() || !mSocket.is_open()) {

Callers 3

sendDataMethod · 0.45
sendHttpRequestHeaderMethod · 0.45

Calls 3

write_someMethod · 0.80
onDisconnectedMethod · 0.80
is_openMethod · 0.45

Tested by

no test coverage detected