crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.2k stars 1.61k forks source link

Refactor `IOCP::OverlappedOperation` internalize `handle` and `wait_for_completion` #14724

Closed straight-shoota closed 6 days ago

straight-shoota commented 1 week ago

Moves the schedule_overlapped overlapped method into OverlappedOperation and call it directly from the result methods, reducing the external API. @handle becomes a property of OverlappedOperation which will be necessary for a follow-up refactor anyway.

straight-shoota commented 6 days ago

I found a workaround for the special case of an accept timeout: https://github.com/crystal-lang/crystal/commit/b919f3be9471ed8addc97d23c1628d5b80d11232

This is quite simple and only temporary. The handling of timeouts will change significantly in a follow-up.