@jrfondren This is brilliant, but please never do `cast[int](socket.getFd)`, you should instead use the safe casting: `socket.getFd().int` (`cast` will do whatever you tell it, including converting types that don't make sense which can cause memory corruption).
Also, consider using `asyncnet`'s UDP support instead of raw selectors. You can simply await `recvFrom` or `sendTo` nowadays: <https://nim-lang.org/docs/asyncnet.html#recvFrom%2CAsyncSocket%2CFutureVar%5Bstring%5D%2Cint%2CFutureVar%5Bstring%5D%2CFutureVar%5BPort%5D>.