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

Method write_some

src/fl/stl/asio/ip/tcp.cpp.hpp:279–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279size_t socket::write_some(fl::span<const u8> buffer, error_code &ec) {
280 ec = error_code();
281 if (mFd == -1) {
282 ec = error_code(errc::operation_aborted, "socket not open");
283 return 0;
284 }
285
286 ssize_t result = plat_send(mFd, (const char *)buffer.data(),
287 buffer.size(), MSG_NOSIGNAL);
288
289 if (result < 0) {
290 if (is_would_block()) {
291 ec = error_code(errc::would_block);
292 return 0;
293 }
294#ifdef FL_IS_WIN
295 ec = error_code(errc::unknown, "send failed");
296#else
297 ec = error_code::from_errno(errno);
298#endif
299 return 0;
300 }
301
302 return static_cast<size_t>(result);
303}
304
305void socket::async_read_some(fl::span<u8> buffer, io_handler handler) {
306 error_code ec;

Callers 3

sendMethod · 0.80
sendMethod · 0.80
FL_TEST_FILEFunction · 0.80

Calls 5

error_codeClass · 0.85
plat_sendFunction · 0.85
is_would_blockFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

FL_TEST_FILEFunction · 0.64