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

Function get_socket_inodes

test/functional/test_framework/netutil.py:29–39  ·  view source on GitHub ↗

Get list of socket inodes for process pid.

(pid)

Source from the content-addressed store, hash-verified

27# STATE_CLOSING = '0B'
28
29def get_socket_inodes(pid):
30 '''
31 Get list of socket inodes for process pid.
32 '''
33 base = '/proc/%i/fd' % pid
34 inodes = []
35 for item in os.listdir(base):
36 target = os.readlink(os.path.join(base, item))
37 if target.startswith('socket:'):
38 inodes.append(int(target[8:-1]))
39 return inodes
40
41def _remove_empty(array):
42 return [x for x in array if x !='']

Callers 1

get_bind_addrsFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected