Advertisement
Korotkodul

client.py

Sep 10th, 2022 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. import socket
  2.  
  3. sock = socket.socket()
  4. sock.connect(('10.8.128.183',9990))
  5. sock.send(b'hello, world!')
  6.  
  7.  
  8. while True:
  9.     data = sock.recv(1024)
  10.     if not data:
  11.         break
  12.     elif data == b"end":
  13.         break
  14.     print(b"from server")
  15.     print(data)
  16.     print()
  17.     message = bytes(input(), 'utf-8')
  18.     sock.send(message)
  19.  
  20. sock.close()
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement