gogoc-messaging/src/windows/pipeio.cc
error_t PipeIO::CanRead( bool& bCanRead ) const
{
  error_t retCode = GOGOCM_UIS__NOERROR;
  DWORD   nBytesAvailable;

  // Verify IPC handle.
  assert( m_Handle != INVALID_HANDLE_VALUE );

  // Take a peek at the pipe to see if we've got stuff to read.
  if( PeekNamedPipe( m_Handle, NULL, 0, NULL, &nBytesAvailable, NULL ) == 0 )
  {
    // PeekNamedPipe failed.
    retCode = GOGOCM_UIS_PEEKPIPEFAILED;
    nBytesAvailable = 0;
  }

  // Set whether we can read or not.
  bCanRead = (nBytesAvailable > 0);


  // Return operation result.
  return retCode;
}
// --------------------------------------------------------------------------
// Function : CanRead
//
// Description:
//   Will verify if a Read operation will be blocking. This is done by 
//   verifying if there's data available for a read operation.
//
// Arguments:
//   bCanRead: boolean [OUT], Boolean indicating if there's data to read.
//
// Return values:
//   GOGOCM_UIS__NOERROR: On successful peek
//   GOGOCM_UIS_PEEKPIPEFAILED: Upon an IO error on the peek.
//
// --------------------------------------------------------------------------
Function : CanRead
Description:
Will verify if a Read operation will be blocking. This is done by
verifying if there's data available for a read operation.

boolean [OUT], Boolean indicating if there's data to read.

Return values:
GOGOCM_UIS__NOERROR: On successful peek
GOGOCM_UIS_PEEKPIPEFAILED: Upon an IO error on the peek.
Function : CanRead Description : Will verify if a Read operation will be blocking . This is done by verifying if there ' s data available for a read operation . boolean [ OUT ] Boolean indicating if there ' s data to read . Return values : GOGOCM_UIS__NOERROR : On successful peek GOGOCM_UIS_PEEKPIPEFAILED : Upon an IO error on the peek .
error_t PipeIO::CanRead( bool& bCanRead ) const
{
  error_t retCode = GOGOCM_UIS__NOERROR;
  DWORD   nBytesAvailable;
  assert( m_Handle != INVALID_HANDLE_VALUE );
  if( PeekNamedPipe( m_Handle, NULL, 0, NULL, &nBytesAvailable, NULL ) == 0 )
  {
    retCode = GOGOCM_UIS_PEEKPIPEFAILED;
    nBytesAvailable = 0;
  }
  bCanRead = (nBytesAvailable > 0);
  return retCode;
}
error_t PipeIO :: CanRead ( bool & bCanRead ) const { error_t retCode = GOGOCM_UIS__NOERROR ; DWORD nBytesAvailable ; assert ( m_Handle != INVALID_HANDLE_VALUE ) ; if ( PeekNamedPipe ( m_Handle , NULL , 0 , NULL , & nBytesAvailable , NULL ) == 0 ) { retCode = GOGOCM_UIS_PEEKPIPEFAILED ; nBytesAvailable = 0 ; } bCanRead = ( nBytesAvailable > 0 ) ; return retCode ; }
Function : CanRead
Description:
Will verify if a Read operation will be blocking.
Function : CanRead Description : Will verify if a Read operation will be blocking .
// Verify IPC handle. // Take a peek at the pipe to see if we've got stuff to read. // PeekNamedPipe failed. // Set whether we can read or not. // Return operation result.