checkpointing connection code