code: func (c *Client) setConnectionState(currentState, newState ConnectionState) bool {
  	return atomic.CompareAndSwapInt32(&c.connectionState, int32(currentState), int32(newState))
  }
docs: // setConnectionState sets the connection state only if the given currentState
  // matches the actual state. True is returned if the connection state was successfully set.