示例#1
0
文件: wsgi.py 项目: plq/spyne
    def get_peer(self):
        addr, port = address_parser.get_ip(self.req),\
                                               address_parser.get_port(self.req)

        if address_parser.is_valid_ipv4(addr):
            return Address(type=Address.TCP4, host=addr, port=port)

        if address_parser.is_valid_ipv6(addr):
            return Address(type=Address.TCP6, host=addr, port=port)
示例#2
0
文件: wsgi.py 项目: cdcanasg/spyne
    def get_peer(self):
        addr, port = address_parser.get_ip(self.req),\
                                               address_parser.get_port(self.req)

        if address_parser.is_valid_ipv4(addr):
            return Address(type=Address.TCP4, host=addr, port=port)

        if address_parser.is_valid_ipv6(addr):
            return Address(type=Address.TCP6, host=addr, port=port)