librnr/sock.c
void SocketUTest()
{
  Socket_T  *pSocket;

  LOGDIAG4("SocketUTest: SocketOpenTcpListener(9192, ANYHOST)");
  if( (pSocket = SocketOpenTcpListener(9192, NULL)) 
         == NULL ) 
  {
    LOGERROR("SocketOpenTcpListener() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }

  LOGDIAG4("SocketUTest: SocketOpenTcpListener(9192, nouturn)");
  if( (pSocket = SocketOpenTcpListener(9192, "nouturn")) 
         == NULL ) 
  {
    LOGERROR("SocketOpenTcpListener() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }

  LOGDIAG4("SocketUTest: SocketOpenTcpConnection(pedxing, 21)");
  if( (pSocket = SocketOpenTcpConnection("pedxing", 21)) == NULL ) 
  {
    LOGERROR("SocketOpenTcpConnection() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }

  LOGDIAG4("SocketUTest: SocketOpenUdp(9193, ANYHOST)");
  if( (pSocket = SocketOpenUdp(9193, NULL)) == NULL ) 
  {
    LOGERROR("SocketOpenUdp() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }

  LOGDIAG4("SocketUTest: SocketOpenUdp(9193, 192.168.1.2)");
  if( (pSocket = SocketOpenUdp(9193, "192.168.2.2")) == NULL ) 
  {
    LOGERROR("SocketOpenUdp() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
}
/*!
 * \brief Socket Unit Tester.
 */
\brief Socket Unit Tester.
\ brief Socket Unit Tester .
void SocketUTest()
{
  Socket_T  *pSocket;
  LOGDIAG4("SocketUTest: SocketOpenTcpListener(9192, ANYHOST)");
  if( (pSocket = SocketOpenTcpListener(9192, NULL)) 
         == NULL ) 
  {
    LOGERROR("SocketOpenTcpListener() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
  LOGDIAG4("SocketUTest: SocketOpenTcpListener(9192, nouturn)");
  if( (pSocket = SocketOpenTcpListener(9192, "nouturn")) 
         == NULL ) 
  {
    LOGERROR("SocketOpenTcpListener() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
  LOGDIAG4("SocketUTest: SocketOpenTcpConnection(pedxing, 21)");
  if( (pSocket = SocketOpenTcpConnection("pedxing", 21)) == NULL ) 
  {
    LOGERROR("SocketOpenTcpConnection() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
  LOGDIAG4("SocketUTest: SocketOpenUdp(9193, ANYHOST)");
  if( (pSocket = SocketOpenUdp(9193, NULL)) == NULL ) 
  {
    LOGERROR("SocketOpenUdp() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
  LOGDIAG4("SocketUTest: SocketOpenUdp(9193, 192.168.1.2)");
  if( (pSocket = SocketOpenUdp(9193, "192.168.2.2")) == NULL ) 
  {
    LOGERROR("SocketOpenUdp() failed");
  }
  else
  {
    LOGDIAG4("  LocalName='%s'", SocketAttrGetLocalName(pSocket)); 
    LOGDIAG4("  RemoteName='%s'", SocketAttrGetRemoteName(pSocket)); 
    SocketClose(pSocket);
    SocketDelete(pSocket);
  }
}
void SocketUTest ( ) { Socket_T * pSocket ; LOGDIAG4 ( " " ) ; if ( ( pSocket = SocketOpenTcpListener ( 9192 , NULL ) ) == NULL ) { LOGERROR ( " " ) ; } else { LOGDIAG4 ( " " , SocketAttrGetLocalName ( pSocket ) ) ; LOGDIAG4 ( " " , SocketAttrGetRemoteName ( pSocket ) ) ; SocketClose ( pSocket ) ; SocketDelete ( pSocket ) ; } LOGDIAG4 ( " " ) ; if ( ( pSocket = SocketOpenTcpListener ( 9192 , " " ) ) == NULL ) { LOGERROR ( " " ) ; } else { LOGDIAG4 ( " " , SocketAttrGetLocalName ( pSocket ) ) ; LOGDIAG4 ( " " , SocketAttrGetRemoteName ( pSocket ) ) ; SocketClose ( pSocket ) ; SocketDelete ( pSocket ) ; } LOGDIAG4 ( " " ) ; if ( ( pSocket = SocketOpenTcpConnection ( " " , 21 ) ) == NULL ) { LOGERROR ( " " ) ; } else { LOGDIAG4 ( " " , SocketAttrGetLocalName ( pSocket ) ) ; LOGDIAG4 ( " " , SocketAttrGetRemoteName ( pSocket ) ) ; SocketClose ( pSocket ) ; SocketDelete ( pSocket ) ; } LOGDIAG4 ( " " ) ; if ( ( pSocket = SocketOpenUdp ( 9193 , NULL ) ) == NULL ) { LOGERROR ( " " ) ; } else { LOGDIAG4 ( " " , SocketAttrGetLocalName ( pSocket ) ) ; LOGDIAG4 ( " " , SocketAttrGetRemoteName ( pSocket ) ) ; SocketClose ( pSocket ) ; SocketDelete ( pSocket ) ; } LOGDIAG4 ( " " ) ; if ( ( pSocket = SocketOpenUdp ( 9193 , " " ) ) == NULL ) { LOGERROR ( " " ) ; } else { LOGDIAG4 ( " " , SocketAttrGetLocalName ( pSocket ) ) ; LOGDIAG4 ( " " , SocketAttrGetRemoteName ( pSocket ) ) ; SocketClose ( pSocket ) ; SocketDelete ( pSocket ) ; } }
\brief Socket Unit Tester.
\ brief Socket Unit Tester .