feat: Semaine 9
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import socket
|
||||
from env_var import SERVER_PORT, CLIENT_PORT
|
||||
|
||||
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
client.bind(("localhost", CLIENT_PORT))
|
||||
client.connect(("localhost", SERVER_PORT))
|
||||
|
||||
print(f"✅ Client connecté au serveur sur port {SERVER_PORT} depuis le port {CLIENT_PORT}")
|
||||
client.send("Salut tout le monde !".encode())
|
||||
|
||||
reponse = client.recv(1024).decode()
|
||||
print(reponse)
|
||||
|
||||
client.close()
|
||||
Reference in New Issue
Block a user