MCPcopy Create free account
hub / github.com/apache/trafficserver / open_connection

Function open_connection

tests/gold_tests/slow_post/slow_post_client.py:48–58  ·  view source on GitHub ↗

Open a connection to the desired host. :param address: The address of the host to connect to. :param port: The port of the host to connect to. :return: The socket connected to the host.

(address: str, port: int)

Source from the content-addressed store, hash-verified

46
47
48def open_connection(address: str, port: int) -> socket.socket:
49 """Open a connection to the desired host.
50
51 :param address: The address of the host to connect to.
52 :param port: The port of the host to connect to.
53 :return: The socket connected to the host.
54 """
55 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
56 sock.connect((address, port))
57 print(f'Connected to {address}:{port}')
58 return sock
59
60
61def send_slow_post(sock: socket.socket, server_hostname: str, send_time: int, finish_request: bool) -> None:

Callers 1

mainFunction · 0.70

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected