MCPcopy Index your code
hub / github.com/python/cpython / echo_client

Method echo_client

Lib/test/test_socket.py:7416–7421  ·  view source on GitHub ↗
(self, addr, family)

Source from the content-addressed store, hash-verified

7414 event.set()
7415
7416 def echo_client(self, addr, family):
7417 with socket.socket(family=family) as sock:
7418 sock.settimeout(self.timeout)
7419 sock.connect(addr)
7420 sock.sendall(b'foo')
7421 self.assertEqual(sock.recv(1024), b'foo')
7422
7423 def test_tcp4(self):
7424 port = socket_helper.find_unused_port()

Callers 4

test_tcp4Method · 0.95
test_tcp6Method · 0.95

Calls 6

socketMethod · 0.80
settimeoutMethod · 0.45
connectMethod · 0.45
sendallMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected