import socket

ip = '127.0.0.1'
port = 5000

def start_client():
    client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    client_socket.connect((ip, port))

    while True:
        message = input("Entrez un message pour le serveur: ")
        
        client_socket.send(message.encode())
        response = client_socket.recv(1024).decode()
        if (response.lower() == "exit"):
            break
        print(response)

    client_socket.close()

start_client()
