trq-1810 refactored getaddrinfo and caching.
trq-1810 refactored getaddrinfo and caching.
Unit test fixing.
fixed some runtime errors.