You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

server_app.py 350B

123456789101112131415
  1. import socket
  2. s = socket.socket()
  3. host = socket.gethostname()
  4. port = 61233
  5. s.bind((host, port))
  6. s.listen()
  7. (connection, addr) = s.accept()
  8. print("Verbindung von ", addr)
  9. while True:
  10. data = connection.recv(1024).decode()
  11. #print("Data = %s" % (data))
  12. #data = "hi"
  13. connection.send(data.upper().encode())
  14. connection.close()