def test_memcached(host, port):
    try:
        s = socket.socket()
        s.connect((host, port))
        return True
    except Exception as exc:
        log.critical('Failed to connect to memcached (%r): %s' %
                     ((host, port), exc))
        return False
    finally:
        s.close()
Connect to memcached.
dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/views.py/test_memcached