mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
websocket server update
This commit is contained in:
@@ -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)
|
Reference in New Issue
Block a user