Chris Siebenmann added the comment:

As far as I know, you can recover everything except the protocol
portably on Unix (and fromfd() will already handwave the protocol).
getsockopt() with SO_TYPE will give you the type. The family can be
recovered by calling getsockname() with a plain struct sockaddr and
then examining sockaddr.sa_family.

As for the other suggestion:

When Python is plugging into larger systems or APIs that pass sockets
around, it is not possible to modify those APIs to pass the additional
information that Python wants (and other environments don't need).
As far as I know, no current protocol that passes file descriptors to
newly started programs or passes file descriptors over Unix sockets
with sendmsg() and SCM_RIGHTS does this. The people responsible for
these protocols are not likely to change them to accommodate Python's
wants. A Python program (and thus Python programmers) get to deal with
the issue themselves if they want Python to participate in these
systems and protocols.

I do want to be able to write Python programs that can interact in
these environments. It is possible to deal with this in C; it is
even possible to hack around this in Python today. I believe that
it should be officially supported.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to