Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch agent from curl-provided select to polling (sagebind#243)
Replace the built-in `select(2)`-based I/O driver with [polling](https://github.com/stjepang/polling), which should deliver noticeably better throughput under high activity, _especially_ on Windows. This implementation took several attempts before I fully understood some of the curl quirks on how it handles sockets; for example, curl will often close sockets before asking them to be de-registered, register and deregister the same file descriptor number between polls (because the OS reused the number), and request sockets to be registered before they are initialized. To handle these quirks this provides a wrapper layer around the polling crate that translates this behavior into something polling can handle. In addition to verifying all the tests pass, I've also run a sort of "soak test" on Linux, Windows, and macOS for 12 hours straight that makes many requests repeatedly in order to weed out potential random errors (I learned of the possible Win32 error code `ERROR_NOT_FOUND (0x490)` this way!). Fixes sagebind#17.
- Loading branch information