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

Method tcp_client

Lib/test/test_asyncio/test_ssl.py:134–147  ·  view source on GitHub ↗
(self, client_prog,
                   family=socket.AF_INET,
                   timeout=support.SHORT_TIMEOUT)

Source from the content-addressed store, hash-verified

132 self, sock, server_prog, timeout, max_clients)
133
134 def tcp_client(self, client_prog,
135 family=socket.AF_INET,
136 timeout=support.SHORT_TIMEOUT):
137
138 sock = socket.socket(family, socket.SOCK_STREAM)
139
140 if timeout is None:
141 raise RuntimeError('timeout is required')
142 if timeout <= 0:
143 raise RuntimeError('only blocking sockets are supported')
144 sock.settimeout(timeout)
145
146 return TestThreadedClient(
147 self, sock, client_prog, timeout)
148
149 def unix_server(self, *args, **kwargs):
150 return self.tcp_server(*args, family=socket.AF_UNIX, **kwargs)

Callers 5

unix_clientMethod · 0.95
test_clientMethod · 0.95
run_mainMethod · 0.95
test_start_server_1Method · 0.45
run_mainMethod · 0.45

Calls 3

socketMethod · 0.80
TestThreadedClientClass · 0.70
settimeoutMethod · 0.45

Tested by

no test coverage detected