import socket
import asyncio
#hello client 1 , hello client 2 do that seq and prallel with thread and with synco prallel and seq
async def fun (clien_socket):
data = clien_socket.recv(1024).decode()
print("Client says:", data)
#create a new connection
HOST = "127.0.0.1" # Localhost
PORT = 5000
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((HOST, PORT))
server.listen(1)
print("Server is waiting for a connection...")
client_socket, client_address = server.accept()
print(f"Connected by {client_address}")
# in here
asyncio.run (fun(client_socket))
client_socket.send("Hello from server!".encode())
client_socket.close()
server.close()