Making connections dependent on OPEN and KEEPALIVE