MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / pollSocket

Function pollSocket

switch/source/transfer.cpp:518–526  ·  view source on GitHub ↗

Waits up to timeoutMs for `events` on sock. Returns 1 if ready, 0 on timeout, -1 on error.

Source from the content-addressed store, hash-verified

516 // Waits up to timeoutMs for `events` on sock. Returns 1 if ready, 0 on
517 // timeout, -1 on error.
518 int pollSocket(int sock, short events, int timeoutMs)
519 {
520 struct pollfd pfd;
521 pfd.fd = sock;
522 pfd.events = events;
523 pfd.revents = 0;
524 int rc = poll(&pfd, 1, timeoutMs);
525 return rc > 0 ? 1 : rc;
526 }
527
528 bool sendAll(int sock, const void* data, size_t len)
529 {

Callers 2

sendAllFunction · 0.70
sendBackupMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected