| 79 | /* ── Small platform helpers ───────────────────────────────────── */ |
| 80 | |
| 81 | static int64_t now_ms(void) { |
| 82 | #ifdef _WIN32 |
| 83 | return (int64_t)GetTickCount64(); |
| 84 | #else |
| 85 | struct timespec ts; |
| 86 | clock_gettime(CLOCK_MONOTONIC, &ts); |
| 87 | return (int64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; |
| 88 | #endif |
| 89 | } |
| 90 | |
| 91 | /* Wait until the socket is readable/writable. 1 = ready, 0 = timeout, -1 = error. |
| 92 | * Windows uses select() deliberately (WSAPoll has a Won't-Fix bug where |
no outgoing calls
no test coverage detected