This commit is contained in:
2019-10-15 15:17:45 +02:00
parent 6f52a291bb
commit dd72d45aef
3 changed files with 16 additions and 5 deletions
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+3 -2
View File
@@ -5,9 +5,10 @@ eingabe = input("Bitte etwas eingeben: ")
s = socket.socket() s = socket.socket()
host = socket.gethostname() host = socket.gethostname()
port = 12345 port = 12345
s.connect((host, port)) s.connect((host, port))
s.send(eingabe.encode('utf-8')) s.send(eingabe.encode('utf-8'))
msgRes = s.recv(1024)
print(msgRes.decode('utf-8'))
s.close() s.close()
+7 -3
View File
@@ -9,7 +9,11 @@ s.listen()
while True: while True:
(connection, addr) = s.accept() (connection, addr) = s.accept()
bytes = s.recv(1024) msg = connection.recv(1024)
print(bytes.decode('utf-8')) msgReturn = msg.decode('utf-8').upper()
connection.send(msgReturn.encode('utf-8'))
connection.close() connection.close()