MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / get_bind_addrs

Function get_bind_addrs

test/functional/test_framework/netutil.py:76–85  ·  view source on GitHub ↗

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

(pid)

Source from the content-addressed store, hash-verified

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

Callers 1

run_bind_testMethod · 0.90

Calls 2

get_socket_inodesFunction · 0.85
netstatFunction · 0.85

Tested by

no test coverage detected