SHARE
TWEET

Untitled

a guest Nov 14th, 2019 105 in 154 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import socket
  2. serv1 = socket.socket()
  3. serv1.bind(("", 9003))
  4. serv1.listen(1)
  5. con,adr = serv1.accept()
  6. print con
  7. print adr
  8.  
  9. while True:
  10.     data = con.recv(1024)
  11.  
  12.     if not data:
  13.         break
  14.  
  15.     con.send("from server " + data)
  16.     print data
  17. serv1.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