import socket s = socket.socket() host = socket.gethostname() port = 22225 s.connect((host, port)) #s.send(message.encode('utf-8')) #bytes = s.recv(1024) #print (bytes.decode('utf-8')) #s.close() message = 'hi' while message != 'STOP': message = input('eingabe: ') s.send(message.encode('utf-8')) bytes = s.recv(4096) print(bytes.decode('utf-8')) else: print(message) s.close()