diff --git a/client.py b/client.py new file mode 100644 index 0000000..c4f6df2 --- /dev/null +++ b/client.py @@ -0,0 +1,13 @@ +import socket +s = socket.socket() +host = socket.gethostname() +port = 22445 + + +s.connect((host, port)) +message = input('eingabe: ') +#bytes = s.sendmsg(message.encode('utf-8')) +test = s.send(message.encode('utf-8')) +msg = s.recv(1024) +print (msg.decode('utf-8')) +s.close() \ No newline at end of file diff --git a/server.py b/server.py new file mode 100644 index 0000000..54bc9ab --- /dev/null +++ b/server.py @@ -0,0 +1,17 @@ +import socket + +s = socket.socket() +host = socket.gethostname() +port = 22445 +s.bind((host, port)) +s.listen() + + +while True: + (connection, addr) = s.accept() + print('verbindung von ', addr) + bytes = connection.recv(1024) + msg = bytes.decode('utf-8') + msg = msg.upper() + connection.send(msg.encode('utf-8')) + connection.close() \ No newline at end of file