Waits up to timeoutMs for `events` on sock. Returns 1 if ready, 0 on timeout, -1 on error.
| 536 | // Waits up to timeoutMs for `events` on sock. Returns 1 if ready, 0 on |
| 537 | // timeout, -1 on error. |
| 538 | int pollSocket(int sock, short events, int timeoutMs) |
| 539 | { |
| 540 | struct pollfd pfd; |
| 541 | pfd.fd = sock; |
| 542 | pfd.events = events; |
| 543 | pfd.revents = 0; |
| 544 | int rc = poll(&pfd, 1, timeoutMs); |
| 545 | return rc > 0 ? 1 : rc; |
| 546 | } |
| 547 | |
| 548 | bool sendAll(int sock, const void* data, size_t len) |
| 549 | { |
no outgoing calls
no test coverage detected