Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.bind(('localhost', 2727))
- sock.listen(1)
- while True:
- channel, details = sock.accept()
- print "We have recieved a connection with", details
- print channel.recv(100)
- channel.send("Hello.")
- channel.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement