Ran into a variant of this when working on an IO loop, ended up with a little "Side" abstraction to wrap bidirectional/unidirectional descriptors to behave identically for the rest of the library. It's an annoying wart but pretty easy to avoid in userspace.. https://github.com/mitogen-hq/mitogen/blob/798032b9/mitogen/...