Are you going to change `hostNameLength` somehow? If no please add `const` qualifier to the variable declaration.
It allows you to avoid accidental changes of this variable.