add : split request

added the version of the code that sends the request in split and times it
This commit is contained in:
2025-09-25 15:35:33 +02:00
parent 14c5f6b1b1
commit 1960eb632b

23
tcp_client_split_call.py Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
import socket
tcp_server_adress = "my_tcp_server.fr"
client_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('{tcp_server_adress}', 80))
request = f"GET / HTTP/1.1\r\n"
request = f"Host: {tcp_server_adress}\r\n\r\n"
sock.sendall(request.encode())
buffer = b""
while True:
data = sock.recv(4096)
if not data:
break
buffer += data
print(buffer.decode())
sock.close()