mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
websocket server update
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
HOST = "127.0.0.1" # Standard loopback interface address (localhost)
|
HOST = "127.0.0.1" # Standard loopback interface address (localhost)
|
||||||
PORT = 4024 # Port to listen on (non-privileged ports are > 1023)
|
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")
|
conn.sendall(b"hallo")
|
||||||
while True:
|
while True:
|
||||||
data = conn.recv(2048)
|
data = conn.recv(2048)
|
||||||
conn.sendall(input("Enter message: ").encode())
|
if data:
|
||||||
if (data):
|
|
||||||
print("received", repr(data))
|
print("received", repr(data))
|
||||||
|
conn.sendall(b"message received")
|
||||||
if not data:
|
if not data:
|
||||||
break
|
break
|
||||||
conn.sendall(data)
|
|
Reference in New Issue
Block a user