SHARE
TWEET

Untitled

a guest Nov 14th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #server
  2.  
  3. import socket
  4. server = socket.socket()
  5. server.bind(('', 9099))
  6. server.listen(1)
  7. print server
  8. con,adr = server.accept()
  9.  
  10. while True:
  11.     data = con.recv(1024)
  12.  
  13.     if not data:
  14.         break
  15.  
  16.     con.send('prinyal ' + data.upper())
  17.     print data
  18. server.close()
  19.  
  20. #client
  21.  
  22. import socket
  23. client = socket.socket()
  24. client.connect(('10.0.53.111', 9003))
  25. client.send('10.0.53.119 9096')
  26. data = client.recv(1024)
  27. print data
  28. client.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top