Included below is the code that I am currently using:
soc1 = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
ADDR = (HOST,PORT)
soc1.connect(ADDR)
soc1.send('WILL SEND')
The error message that I receive when running the above code is:
Traceback (most recent call last):
File "C:\workspace\wx_python_test\chat_server.py", line 25, in <module>
soc1.connect(ADDR)
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 10061]
Could anyone please explain what the issue is that I am experiencing and how I can correct it?
Full source code: http://pastie.org/4245314
socket.error: [Errno 10061]indicates that the port you are trying to connect to is not open. You need to make sure that the port is open and something is listening for your connection to be made.It appears that you are trying to test a chat server. In order for the chat server to work properly you will want to make sure that it is currently listening on the specified port.
Twisted provides a good framework if you haven’t checked it out previously.