rx3:index
This is an old revision of the document!
Table of Contents
Réseau L2 Info : Socket en Python 3
Client TCP
#!/usr/bin/python3 import sys import socket HOST = 'www.labri.fr' PORT = 80 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.sendall(b'GET /\r\n\r\n') data = s.recv(1024) s.close() print ('Received', data)
Serveur TCP
Documentation
rx3/index.1490342878.txt.gz · Last modified: 2024/03/18 15:05 (external edit)