MCPcopy Create free account
hub / github.com/ElementsProject/elements / get_bind_addrs

Function get_bind_addrs

test/functional/test_framework/netutil.py:75–84  ·  view source on GitHub ↗

Get bind addresses as (host,port) tuples for process pid.

(pid)

Source from the content-addressed store, hash-verified

73 return result
74
75def get_bind_addrs(pid):
76 '''
77 Get bind addresses as (host,port) tuples for process pid.
78 '''
79 inodes = get_socket_inodes(pid)
80 bind_addrs = []
81 for conn in netstat('tcp') + netstat('tcp6'):
82 if conn[3] == STATE_LISTEN and conn[4] in inodes:
83 bind_addrs.append(conn[1])
84 return bind_addrs
85
86# from: https://code.activestate.com/recipes/439093/
87def all_interfaces():

Callers 2

run_testMethod · 0.90
run_bind_testMethod · 0.90

Calls 2

get_socket_inodesFunction · 0.70
netstatFunction · 0.70

Tested by

no test coverage detected