MCPcopy Index your code
hub / github.com/apache/dubbo-python2 / get_ip

Function get_ip

dubbo/common/util.py:58–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def get_ip():
59 global ip
60 if ip:
61 return ip
62 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
63 try:
64 sock.connect(('8.8.8.8', 80))
65 ip = sock.getsockname()[0]
66 logger.debug('Current IP Address: {}'.format(ip))
67 finally:
68 sock.close()
69 return ip
70
71
72def get_pid():

Callers 1

_register_consumerMethod · 0.90

Calls 2

formatMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected