Exception Errno.CONNREFUSED handled when creating a socket