client: use ring buffer size for graceful close
client: small rename
client: refactor