librnr/sock.c
static int SockResolveHostName(const char *sHostName, struct in_addr *pAddrInet)
{
  struct hostent  *pHostEntry;
  struct in_addr   addrInet;

  // hostname: "www.xxx.yyy.zzz" (IPv4)
  if( inet_aton(sHostName, &addrInet) != 0 )
  {
    memcpy(pAddrInet, &addrInet, sizeof(addrInet));
  }
  // hostname: "www.xxx.yyy.zzz" (IPv4) or "networkname" (may use DNS)
  else if( (pHostEntry = gethostbyname(sHostName)) != NULL )
  {
    memcpy(pAddrInet, pHostEntry->h_addr, (size_t)pHostEntry->h_length);
  }
  else
  {
    LOGERROR("gethostbyname(%s): %s", sHostName, hstrerror(h_errno));
    return -1; 
  }

  return OK;
}
/*!
 * \brief Resolve host name into IP address (IPV4 only).
 *
 * \param sHostName Host name in dotted or DNS network format. 
 * \param pAddrInet IP address
 *
 * \return Returns 0 on success, -1 on failure.
 */
\brief Resolve host name into IP address (IPV4 only).
\param sHostName Host name in dotted or DNS network format.
\param pAddrInet IP address

\return Returns 0 on success, -1 on failure.
\ brief Resolve host name into IP address ( IPV4 only ) . \ param sHostName Host name in dotted or DNS network format . \ param pAddrInet IP address \ return Returns 0 on success - 1 on failure .
static int SockResolveHostName(const char *sHostName, struct in_addr *pAddrInet)
{
  struct hostent  *pHostEntry;
  struct in_addr   addrInet;
  if( inet_aton(sHostName, &addrInet) != 0 )
  {
    memcpy(pAddrInet, &addrInet, sizeof(addrInet));
  }
   or "networkname" (may use DNS)
  else if( (pHostEntry = gethostbyname(sHostName)) != NULL )
  {
    memcpy(pAddrInet, pHostEntry->h_addr, (size_t)pHostEntry->h_length);
  }
  else
  {
    LOGERROR("gethostbyname(%s): %s", sHostName, hstrerror(h_errno));
    return -1; 
  }
  return OK;
}
static int SockResolveHostName ( const char * sHostName , struct in_addr * pAddrInet ) { struct hostent * pHostEntry ; struct in_addr addrInet ; if ( inet_aton ( sHostName , & addrInet ) != 0 ) { memcpy ( pAddrInet , & addrInet , sizeof ( addrInet ) ) ; } else if ( ( pHostEntry = gethostbyname ( sHostName ) ) != NULL ) { memcpy ( pAddrInet , pHostEntry -> h_addr , ( size_t ) pHostEntry -> h_length ) ; } else { LOGERROR ( " " , sHostName , hstrerror ( h_errno ) ) ; return -1 ; } return OK ; }
\brief Resolve host name into IP address (IPV4 only).
\ brief Resolve host name into IP address ( IPV4 only ) .
// hostname: "www.xxx.yyy.zzz" (IPv4) // hostname: "www.xxx.yyy.zzz" (IPv4) or "networkname" (may use DNS)