state-keeping for connection