MCPcopy Create free account
hub / github.com/antirez/ds4 / web_write_all

Function web_write_all

ds4_web.c:218–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static int web_write_all(int fd, const void *buf, size_t len) {
219 const char *p = buf;
220 while (len) {
221#ifdef MSG_NOSIGNAL
222 ssize_t n = send(fd, p, len, MSG_NOSIGNAL);
223#else
224 ssize_t n = write(fd, p, len);
225#endif
226 if (n < 0 && errno == EINTR) continue;
227 if (n <= 0) return -1;
228 p += n;
229 len -= (size_t)n;
230 }
231 return 0;
232}
233
234static ssize_t web_read_some(int fd, char *buf, size_t len, int timeout_ms) {
235 struct pollfd pfd = {.fd = fd, .events = POLLIN};

Callers 4

web_http_requestFunction · 0.85
web_ws_connectFunction · 0.85
web_ws_send_textFunction · 0.85
web_ws_send_pongFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected