Testing socket connection in Python
It seems that you catch not the exception you wanna catch out there 🙂 if the s is a socket.socket() object, then the right way to call .connect would be: import socket s = socket.socket() address=”127.0.0.1″ port = 80 # port number is a number, not string try: s.connect((address, port)) # originally, it was # … Read more