From 465634e1cd95d097d2d1c6bb4ebd06d68be2911f Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Wed, 25 Sep 2024 16:41:23 +0200 Subject: [PATCH] websocket server update --- src/Python/socket/socketServer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Python/socket/socketServer.py b/src/Python/socket/socketServer.py index aff8942..252994e 100644 --- a/src/Python/socket/socketServer.py +++ b/src/Python/socket/socketServer.py @@ -1,6 +1,5 @@ import socket - HOST = "127.0.0.1" # Standard loopback interface address (localhost) PORT = 4024 # Port to listen on (non-privileged ports are > 1023) @@ -13,9 +12,8 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: conn.sendall(b"hallo") while True: data = conn.recv(2048) - conn.sendall(input("Enter message: ").encode()) - if (data): + if data: print("received", repr(data)) + conn.sendall(b"message received") if not data: - break - conn.sendall(data) \ No newline at end of file + break \ No newline at end of file