Web_engingeering/server_app.py
2019-10-29 14:20:41 +01:00

15 lines
350 B
Python
Executable File

import socket
s = socket.socket()
host = socket.gethostname()
port = 61233
s.bind((host, port))
s.listen()
(connection, addr) = s.accept()
print("Verbindung von ", addr)
while True:
data = connection.recv(1024).decode()
#print("Data = %s" % (data))
#data = "hi"
connection.send(data.upper().encode())
connection.close()