示例#1
0
/*|><|************************************************************************
*
* Method Name:  FlushMessages
*
*
* Inputs:       None
*
* Outputs:      None
*
* Returns:      bool
*
* Logic Notes:
*
* Caveats:
*
************************************************************************|<>|*/
void CMsgQueue::FlushMessages(void)
{
#ifdef WIN32 /* [ */
    CMessage *poMessage;

    // Let's iterate through the list and remove all messages it contains.
    poMessage = RemoveFirstEntry();
    while(poMessage)
    {
        // Delete the memory associated with the message.  This of course
        // assumes that the memory was dynamically allocated.  This might
        // be a dangerous assumption.
        delete poMessage;

        // Remove the next message from the list
        poMessage = RemoveNextEntry();
    }
#elif defined(_VXWORKS) /* ] [ */
    CMessage *poMessage;

    // Block Waiting for a new message to arrive on the FIFO
    while(ERROR != msgQReceive(m_ulMsgQID,
        (char *)&poMessage, sizeof(CMessage *), NO_WAIT_TIME))
            delete poMessage;
#elif defined(__pingtel_on_posix__)
    m_pMsgQ->flush();
#endif /* ] */

}
示例#2
0
/**
 *
 * Method Name: TerminateAllConnections
 *
 *
 * Inputs:      None
 *
 * Outputs:     None
 *
 * Returns:     bool

 *
 * Description: The TerminateAllConnections() method shall manage the
 *              termination of all RTCP connections.  This shall include the
 *              graceful release of all associated objects as well as the
 *              deallocation of all resources associated with each contained
 *              RTCP connection.
 *
 *
 * Usage Notes:
 *
 *
 */
void CRTCPSession::TerminateAllConnections(void)
{

    // Reset All Connections
    ResetAllConnections((unsigned char *)"Normal Session Termination");

    // Remove all RTCP Connections
    CRTCPConnection *poRTCPConnection = RemoveFirstEntry();
    while (poRTCPConnection != NULL)
    {
#if RTCP_DEBUG /* [ */
        if(bPingtelDebug)
        {
            osPrintf("*** RTCP CONNECTION TERMINATED ****\n");
            osPrintf("\t ON SESSION ==> %d\n", GetSessionID());
            osPrintf("\t TO SSRC    ==> %u\n",
                                           poRTCPConnection->GetRemoteSSRC());
        }
#endif /* RTCP_DEBUG ] */

        // Terminate RTCPConnection and release reference
        poRTCPConnection->Terminate();

        // Release reference twice.  Once for its removal from the collection
        //  and once on behalf fo the client since this method serves to
        //  terminate the connection and release the client's reference.
        ((IRTCPConnection *)poRTCPConnection)->Release();
        ((IRTCPConnection *)poRTCPConnection)->Release();

        // Remove Next Entry
        poRTCPConnection = RemoveNextEntry();
    }

}