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

Method send

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

Source from the content-addressed store, hash-verified

95}
96
97int NativeHttpServer::send(u32 clientId, fl::span<const u8> data) {
98 ServerClientConnection* client = findClient(clientId);
99 if (!client || !client->socket.is_open()) {
100 return -1;
101 }
102
103 asio::error_code ec;
104 size_t n = client->socket.write_some(data, ec);
105
106 if (ec) {
107 if (ec.code == asio::errc::would_block) {
108 return 0;
109 }
110 // Connection error, disconnect client
111 client->connection.onDisconnected();
112 return -1;
113 }
114
115 return static_cast<int>(n);
116}
117
118int NativeHttpServer::recv(u32 clientId, fl::span<u8> buffer) {
119 ServerClientConnection* client = findClient(clientId);

Callers

nothing calls this directly

Calls 3

write_someMethod · 0.80
onDisconnectedMethod · 0.80
is_openMethod · 0.45

Tested by

no test coverage detected