示例#1
0
def get_external_ip():
    """
    Returns a deferred which will be called with the WAN ip address
    retreived through UPnP. The ip is a string of the form "x.x.x.x"
    
    @return: A deferred called with the external ip address of this host
    @rtype: L{twisted.internet.defer.Deferred}
    """
    return search_upnp_device().addCallback(lambda x: x.get_external_ip())
示例#2
0
文件: __init__.py 项目: gyver/p2pool
def get_port_mapper():
	"""
	Returns a deferred which will be called with a L{UPnPMapper} instance.
	This is a L{nattraverso.portmapper.NATMapper} implementation.
	
	@return: A deferred called with the L{UPnPMapper} instance.
	@rtype: L{twisted.internet.defer.Deferred}
	"""
	return search_upnp_device().addCallback(lambda x: UPnPMapper(x))
示例#3
0
def get_port_mapper():
    """
    Returns a deferred which will be called with a L{UPnPMapper} instance.
    This is a L{nattraverso.portmapper.NATMapper} implementation.
    
    @return: A deferred called with the L{UPnPMapper} instance.
    @rtype: L{twisted.internet.defer.Deferred}
    """
    return search_upnp_device().addCallback(lambda x: UPnPMapper(x))
示例#4
0
文件: __init__.py 项目: gyver/p2pool
def get_external_ip():
	"""
	Returns a deferred which will be called with the WAN ip address
	retreived through UPnP. The ip is a string of the form "x.x.x.x"
	
	@return: A deferred called with the external ip address of this host
	@rtype: L{twisted.internet.defer.Deferred}
	"""
	return search_upnp_device().addCallback(lambda x: x.get_external_ip())