MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_socket

Function check_socket

tests/test_gossip.py:1957–1967  ·  view source on GitHub ↗
(ip_addr, port)

Source from the content-addressed store, hash-verified

1955
1956
1957def check_socket(ip_addr, port):
1958 result = True
1959 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1960 # let's also check for fatal and try it ;-)
1961 try:
1962 result = sock.connect_ex((ip_addr, port))
1963 sock.close()
1964 except Exception:
1965 return False
1966
1967 return not result
1968
1969
1970@pytest.mark.developer("needs a running Tor service instance at port 9151 or 9051")

Callers 2

test_statictor_onionsFunction · 0.85
test_torport_onionsFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected