NightRaven97

Server

May 11th, 2016
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #Server
  2. import socket
  3.  
  4. s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  5. host="192.168.2.1"
  6. port=12345
  7.  
  8. s.connect((host,port))
  9. s.listen(5)
  10.  
  11. while True:
  12.     client,addr=s.accept()
  13.     print("Connection successful!")
  14.     client.send("Hi push! xD".encode())
  15.     client.close()
Add Comment
Please, Sign In to add comment