properly getting ip address and hostname of connected socket