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

Function open_connection

tests/gold_tests/post/expect_client.py:44–54  ·  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

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

Callers 1

mainFunction · 0.70

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected