feat: Semaine 9

This commit is contained in:
gauvainboiche
2026-05-15 16:24:56 +02:00
parent 3315cb2336
commit ce1f0e513a
108 changed files with 3150 additions and 0 deletions
@@ -0,0 +1,24 @@
#client
import socket
import threading
from utils import receive_messages, send_messages
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(("localhost", 9999))
pseudo = input("Choisissez votre pseudo : ")
client_socket.send(pseudo.encode())
print(f"Connecté au chat en tant que {pseudo} !\n")
thread_recv = threading.Thread(target=receive_messages, args=(client_socket,))
thread_send = threading.Thread(target=send_messages, args=(client_socket,))
thread_recv.start()
thread_send.start()
thread_recv.join()
thread_send.join()
print("Chat terminé.")