librnr/sockset.c
static int SockSetChkSd(Socket_T *pSocket)
{
  int   sd;   // socket descriptor

  CHKPTR(pSocket, SOCK_RC_EBADSOCK);

  // this socket isn't open
  if( !SocketStateIsOpen(pSocket) )
  {
    LOGERROR("Socket not open");
    return SOCK_RC_EBADSD;
  }

  sd = SocketAttrGetSd(pSocket);

  if( sd >= FD_SETSIZE )
  {
    LOGERROR("Socket '%s' descriptor %d > %d: too big", 
        SocketAttrGetLocalName(pSocket), sd, FD_SETSIZE);
    return SOCK_RC_EBADSD;
  }

  return sd;
}
/*! 
 * \brief Check if socket is open and within valid range.
 *
 * \param pSocket   Pointer to socket.
 *
 * \return
 * Returns socket descriptor if valid.\n
 * Otherwise the appropriate socket return code \< 0 is returned.
 */
\brief Check if socket is open and within valid range.
\param pSocket   Pointer to socket.

\return
Returns socket descriptor if valid.\n
Otherwise the appropriate socket return code \< 0 is returned.
\ brief Check if socket is open and within valid range . \ param pSocket Pointer to socket . \ return Returns socket descriptor if valid . \ n Otherwise the appropriate socket return code \ < 0 is returned .
static int SockSetChkSd(Socket_T *pSocket)
{
  int   sd;   
  CHKPTR(pSocket, SOCK_RC_EBADSOCK);
  if( !SocketStateIsOpen(pSocket) )
  {
    LOGERROR("Socket not open");
    return SOCK_RC_EBADSD;
  }
  sd = SocketAttrGetSd(pSocket);
  if( sd >= FD_SETSIZE )
  {
    LOGERROR("Socket '%s' descriptor %d > %d: too big", 
        SocketAttrGetLocalName(pSocket), sd, FD_SETSIZE);
    return SOCK_RC_EBADSD;
  }
  return sd;
}
static int SockSetChkSd ( Socket_T * pSocket ) { int sd ; CHKPTR ( pSocket , SOCK_RC_EBADSOCK ) ; if ( ! SocketStateIsOpen ( pSocket ) ) { LOGERROR ( " " ) ; return SOCK_RC_EBADSD ; } sd = SocketAttrGetSd ( pSocket ) ; if ( sd >= FD_SETSIZE ) { LOGERROR ( " " , SocketAttrGetLocalName ( pSocket ) , sd , FD_SETSIZE ) ; return SOCK_RC_EBADSD ; } return sd ; }
\brief Check if socket is open and within valid range.
\ brief Check if socket is open and within valid range .
// socket descriptor // this socket isn't open