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.py 344B

1234567891011121314151617
  1. import socket
  2. s = socket.socket()
  3. host = socket.gethostname()
  4. port = 22445
  5. s.bind((host, port))
  6. s.listen()
  7. while True:
  8. (connection, addr) = s.accept()
  9. print('verbindung von ', addr)
  10. bytes = connection.recv(1024)
  11. msg = bytes.decode('utf-8')
  12. msg = msg.upper()
  13. connection.send(msg.encode('utf-8'))
  14. connection.close()