Browse Source

Vers 2

master
Amad Colovic 5 years ago
parent
commit
754fd64566
2 changed files with 10 additions and 2 deletions
  1. 2
    0
      client.py
  2. 8
    2
      server.py

+ 2
- 0
client.py View File



eingabe = input ("Bitte etwas eingeben:") eingabe = input ("Bitte etwas eingeben:")



s.connect((host, port)) s.connect((host, port))
s.send(eingabe.encode("utf-8"))
bytes = s.recv(1024) bytes = s.recv(1024)
print(bytes.decode("utf-8")) print(bytes.decode("utf-8"))
s.close() s.close()

+ 8
- 2
server.py View File

while True: while True:
(connection, addr) = s.accept() (connection, addr) = s.accept()
print("Verbindung von ", addr) print("Verbindung von ", addr)
msg = "Danke für das Vorbeischauen!"
connection.send(msg.encode("utf-8"))
data = connection.recv(1024)
data = data.decode("utf-8")
data = data.upper()
print(data)
connection.send(data.encode("utf-8"))

#msg = "Danke für das Vorbeischauen!"
# connection.send(msg.encode("utf-8"))
connection.close() connection.close()

Loading…
Cancel
Save