setConnectionState

Applies newState and advances epochs exactly once when the state changes.