MCPcopy Index your code
hub / github.com/RustPython/RustPython / tcp_client

Method tcp_client

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

Source from the content-addressed store, hash-verified

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