Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. class Server:
  2. def send_d(self):
  3. with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
  4. s.bind(('localhost',64343))
  5. conn, addr = s.accept()
  6. conn.send(('Hello').encode())
  7.  
  8. class Client:
  9. def rec_data(self):
  10. with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
  11. s.connect(('localhost', 64343))
  12. message = s.recv(1024)
  13. print(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement