Add keepalives and connection termination.