I am Japanese and I am not good at speaking English. Please let me know if there is anything I say that you don't understand.
I have a question regarding Python's socket module.
I am setting up an IRC server on a virtual machine and I am trying to create an IRC bot with Python, but I am unable to connect to the server.
I have tried the following minimal code:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(5) # set timeout to 5 seconds
sock.connect(('xxx.xx.xxx.xx', 6667))
However, it times out and I am unable to connect. I have checked the server's IP address using ping and it returns a response. The virtual machine is running CentOS 7 and both SElinux and firewall are disabled. Ruby code works properly and LimeChat2 on my local PC can also connect without any issues.
Please let me know what could be the possible reasons for this issue. The port number is correct.