NCHK-2849: Use the hostname when connecting the socket

@santoch