|
|
@@ -4,29 +4,27 @@ SOCKET = socket.socket() |
|
|
|
HOST = socket.gethostname() |
|
|
|
PORT = 45670 |
|
|
|
|
|
|
|
|
|
|
|
SOCKET.bind((HOST, PORT)) |
|
|
|
SOCKET.listen() |
|
|
|
|
|
|
|
|
|
|
|
while True: |
|
|
|
(connection, addr) = SOCKET.accept() |
|
|
|
|
|
|
|
print("Server: " + addr[0] + " Port: " + str(addr[1])) |
|
|
|
|
|
|
|
eingabe = connection.recv(1024) |
|
|
|
while True: |
|
|
|
eingabe = connection.recv(1024) |
|
|
|
|
|
|
|
msg = eingabe.decode("utf-8") |
|
|
|
msg = msg.upper() |
|
|
|
msg = eingabe.decode("utf-8") |
|
|
|
msg = msg.upper() |
|
|
|
|
|
|
|
print(msg) |
|
|
|
print(msg) |
|
|
|
|
|
|
|
if msg == "STOP": |
|
|
|
connection.close() |
|
|
|
SOCKET.close() |
|
|
|
break |
|
|
|
if msg == "STOP": |
|
|
|
break |
|
|
|
|
|
|
|
connection.send(msg.encode("utf-8")) |
|
|
|
connection.send(msg.encode("utf-8")) |
|
|
|
|
|
|
|
connection.close() |
|
|
|
|
|
|
|
SOCKET.close() |