Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
File descriptor usage is needlessly doubled #470
This may be a duplicate ticket, but just in case.. Due to #26, at present the receive_side and transmit_side of every stream actually keep a private dup() of the socket/pipe/whatever file descriptor, even though the whole point of Side is to manage the lifetime of a potentially shared descriptor.
This was a 'quick' workaround for there being no clarity early on about when/where close() should be called for an FD. Now that is clearer (any FD added to a broker's poller must be closed on the broker thread), a single Side instance should be assigned to both receive_side and transmit_side, so only one system FD exists.
I think really the only problem right now is that it's burning RAM needlessly, FDs aren't free. But it's still something that needs to be carefully fixed.
see also (same underlying problem) #147