Fix hostname length bug

The length of the hostname in some platforms can be larger than 255 bytes.
And I don't want to include those headers define the max hostname length in current platform,
so simply define a new MACRO to finish this job.
Merge pull request #132 from RockLi/fix-hostname-length

Fix hostname length issue