mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: For servers NIO had a race where when you start tearing down the `ServerSocketChannel` and at roughly the same time a client connects, we would not fully bring that channel up, nor tear it down. That lead to open channels being deallocated which leads to a crash as that's an illegal state. Modifications: Made sure newly accepted channels get closed if the `ServerSocketChannel` is already clsing. Result: No crashes anymore when a client connects to a closing server.