Waits up to timeoutMs for `events` on sock. Returns 1 if ready, 0 on timeout, -1 on error.
| 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 | { |
no outgoing calls
no test coverage detected