This commit is contained in:
Tu Quyen Tran Ngoc 2019-10-15 15:30:02 +02:00
parent dd72d45aef
commit 2988f4fb71
2 changed files with 32 additions and 0 deletions

17
clie2_file.py Normal file
View File

@ -0,0 +1,17 @@
import socket
eingabe = input("Bitte etwas eingeben: ")
s = socket.socket()
host = socket.gethostname()
port = 12345
s.connect((host, port))
while eingabe != "STOP":
s.send(eingabe.encode('utf-8'))
eingabe = input("Bitte etwas eingeben: ")
else:
s.close()

15
serv2_file.py Normal file
View File

@ -0,0 +1,15 @@
import socket
s = socket.socket()
host = socket.gethostname()
port = 12345
s.bind((host, port))
s.listen()
while True:
(connection, addr) = s.accept()
msg = connection.recv(1024)
msgReturn = msg.decode('utf-8').upper()
connection.send(msgReturn.encode('utf-8'))
connection.close()