Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File "client.py", line 6, in <module>
- s.connect((host, port))
- File "/usr/lib/python2.7/socket.py", line 228, in meth
- return getattr(self._sock,name)(*args)
- socket.error: [Errno 111] Connection refused
- `import socket`
- s = socket.socket(socket.AF_INET6,socket.SOCK_STREAM)
- host = "127.0.0.1"
- port = 5005
- s.connect((host, port))
- print(s.recv(1024))
- s.send('send me a salutation')
- s.close()
- import socket
- s=socket.socket()
- address = ''
- port = 5005
- s.bind((address,port))
- s.listen(5)
- while True:
- conn,addr=s.accept()
- print 'Connection address: ',addr
- conn.send('Thank you for your connecting')
- conn.close()
Add Comment
Please, Sign In to add comment