| 59 | /* ── Small platform helpers ───────────────────────────────────── */ |
| 60 | |
| 61 | static int64_t now_ms(void) { |
| 62 | #ifdef _WIN32 |
| 63 | return (int64_t)GetTickCount64(); |
| 64 | #else |
| 65 | struct timespec ts; |
| 66 | clock_gettime(CLOCK_MONOTONIC, &ts); |
| 67 | return (int64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; |
| 68 | #endif |
| 69 | } |
| 70 | |
| 71 | /* Wait until the socket is readable. 1 = readable, 0 = timeout, -1 = error. |
| 72 | * Windows uses select() deliberately (WSAPoll has a Won't-Fix bug where |
no outgoing calls
no test coverage detected