saghul/pyuv — pull request #158 by geertj (2014-05-15 10:09:20+00:00)
Title: Implement _fileno() for Stream and UDP.

This method returns the libuv file descriptor for a Stream or a UDP
handle. It should be considered an internal API and can break things
horribly if abused. The file descriptor that is returned will still be
"owned" by the libuv Handle, and libuv assumes it has full and unique
ownership of the descriptor and that nobody will change it.

This method is Unix only. On Windows this returns -1.

The method is useful e.g. call non-invasive getsockopt() calls such as
SO_PEERCRED on Pipes.

See also https://github.com/saghul/pyuv/issues/157 for an idea how
cleaner API might be added to libuv in the future.