Skip to content
Snippets Groups Projects
Select Git revision
  • 3b266aed3b6bcafa053fee78b994711b407a8e6a
  • master default
  • nouvelle_branche
  • branche_formation
  • 2023
  • branche-avec-truc-style
  • branche-a-rebase
7 results

main.py

Blame
  • client.py 277 B
    import socket
    
    host = socket.gethostname()
    port = 12345                   # The same port as used by the server
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host, port))
    s.sendall(b'Hello, world')
    data = s.recv(1024)
    s.close()
    print('Received', repr(data))