Hi there,
I have an FTP server application to which I'd like to add IPv6
support.
I'd like to know how could I determine the family of a socket.socket
instance which may be AF_INET or AF_INET6.
Is there some kind of getsockopt() directive I could use?
For now I've been able to determine the family by using:

# self.socket = a connected socket.socket instance
ip, port = self.socket.getsockname()[0:2]
af = socket.getaddrinfo(ip, port)[0][0]


....but I'd like to know if some other solution is preferable.
Could someone please point me in the right direction?


Thanks.


--- Giampaolo
http://code.google.com/p/pyftpdlib