librnr/sock.c
void SocketAttrSetLocalName(Socket_T *pSocket, const char *sHostName)
{
  struct sockaddr_un addr;    // largest address size (is there a better way?)
  socklen_t          sizAddr;

  CHKPTR(pSocket);

  delete(pSocket->m_sLocalName);

  sizAddr = (socklen_t)sizeof(addr);

  // closed
  if( !SocketStateIsOpen(pSocket) )
  {
    pSocket->m_sLocalName = new_strdup(SockStrClosed);
  }

  // error leg - simply use host name
  else if( getsockname(pSocket->m_sd, (struct sockaddr *)&addr, &sizAddr) < 0 )
  {
    LOGSYSERROR("getsockname(%d, ...)", pSocket->m_sd);
    pSocket->m_sLocalName = new_strdup(sHostName);
  }

  // get local address
  else 
  {
    pSocket->m_sLocalName = SocketAddrName((struct sockaddr *)&addr, sHostName);
  }
}
/*!
 * \brief Set Socket local name.
 *
 * \param pSocket     Pointer to Socket.
 * \param sHostName   Local host name string.
 */
\brief Set Socket local name.
\param pSocket     Pointer to Socket.
\param sHostName   Local host name string.
\ brief Set Socket local name . \ param pSocket Pointer to Socket . \ param sHostName Local host name string .
void SocketAttrSetLocalName(Socket_T *pSocket, const char *sHostName)
{
  struct sockaddr_un addr;    
  socklen_t          sizAddr;
  CHKPTR(pSocket);
  delete(pSocket->m_sLocalName);
  sizAddr = (socklen_t)sizeof(addr);
  if( !SocketStateIsOpen(pSocket) )
  {
    pSocket->m_sLocalName = new_strdup(SockStrClosed);
  }
  else if( getsockname(pSocket->m_sd, (struct sockaddr *)&addr, &sizAddr) < 0 )
  {
    LOGSYSERROR("getsockname(%d, ...)", pSocket->m_sd);
    pSocket->m_sLocalName = new_strdup(sHostName);
  }
  else 
  {
    pSocket->m_sLocalName = SocketAddrName((struct sockaddr *)&addr, sHostName);
  }
}
void SocketAttrSetLocalName ( Socket_T * pSocket , const char * sHostName ) { struct sockaddr_un addr ; socklen_t sizAddr ; CHKPTR ( pSocket ) ; delete ( pSocket -> m_sLocalName ) ; sizAddr = ( socklen_t ) sizeof ( addr ) ; if ( ! SocketStateIsOpen ( pSocket ) ) { pSocket -> m_sLocalName = new_strdup ( SockStrClosed ) ; } else if ( getsockname ( pSocket -> m_sd , ( struct sockaddr * ) & addr , & sizAddr ) < 0 ) { LOGSYSERROR ( " " , pSocket -> m_sd ) ; pSocket -> m_sLocalName = new_strdup ( sHostName ) ; } else { pSocket -> m_sLocalName = SocketAddrName ( ( struct sockaddr * ) & addr , sHostName ) ; } }
\brief Set Socket local name.
\ brief Set Socket local name .
// largest address size (is there a better way?) // closed // error leg - simply use host name // get local address