示例#1
0
// Destructor
SipTlsServer::~SipTlsServer()
{
    waitUntilShutDown();
    if (mpServerBrokerListener)
    {
        mpServerBrokerListener->requestShutdown();
        delete mpServerBrokerListener;
    }
    {
        SipServerBroker* pBroker = NULL;
        UtlHashMapIterator iterator(this->mServerBrokers);
        UtlVoidPtr* pBrokerContainer = NULL;
        UtlString* pKey = NULL;
        
        while (pKey = (UtlString*)iterator())
        {
            pBrokerContainer = (UtlVoidPtr*)iterator.value();
            if (pBrokerContainer)
            {
                pBroker = (SipServerBroker*)pBrokerContainer->getValue();
                if (pBroker)
                {
                    pBroker->requestShutdown();
                    delete pBroker;
                }
            }
        }
        mServerBrokers.destroyAll();
    }

/*
    {
        OsSocket* pSocket = NULL;
        UtlHashMapIterator iterator(mServerSocketMap);
        UtlVoidPtr* pSocketContainer = NULL;
        UtlString* pKey = NULL;
        
        while (pKey = (UtlString*)iterator())
        {
            pSocketContainer = (UtlVoidPtr*)iterator.value();
            if (pSocketContainer)
            {
                pSocket = (OsSocket*)pSocketContainer->getValue();
                if (pSocket)
                {
                    delete pSocket;
                }
            }
        }
        mServerSocketMap.destroyAll();
    }
*/
    mServerSocketMap.destroyAll();
    mServerPortMap.destroyAll();


}
示例#2
0
// Destructor
MpMediaTask::~MpMediaTask()
{
   // $$$ need to figure out how to cleanly shut down this task after
   // $$$ unmanaging and destroying all of its flow graphs

   waitUntilShutDown() ;
   delete[] mManagedFGs;
   spInstance = NULL;
}
SubscribeServerThread::~SubscribeServerThread()
{
    waitUntilShutDown();
    if( mpSipUserAgent )
        mpSipUserAgent = NULL;

    if( mPluginTable )
        mPluginTable = NULL;
}
示例#4
0
/// Destructor
RegistrarPersist::~RegistrarPersist()
{
   /*
    * This is called from the SipRegistrar task destructor.
    * The shutdown message has already been sent to wake up the task;
    * block the destructor until shutdown is complete.
    */
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "RegistrarPersist::~ waiting for shutdown");
   waitUntilShutDown();
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "RegistrarPersist::~ task shutdown");
}
示例#5
0
// Destructor
MpStreamPlayer::~MpStreamPlayer()
{
   destroy() ;

   waitForDestruction() ;
   waitUntilShutDown() ;

   if (mpQueueEvent != NULL)
   {
      delete mpQueueEvent ;
      mpQueueEvent = NULL ;
   }
}
示例#6
0
// Destructor
MpMediaTask::~MpMediaTask()
{
   // $$$ need to figure out how to cleanly shut down this task after
   // $$$ unmanaging and destroying all of its flow graphs

   waitUntilShutDown();

#if FRAME_PROCESSING_THREADS > 0
   for (int i = 0; i < FRAME_PROCESSING_THREADS; i++)
   {
      // shutdown threads
      m_processingThreads[i]->requestShutdown();
      delete m_processingThreads[i];
      m_processingThreads[i] = NULL;
   }
#endif

   if (m_pFrameStartTimer)
   {
      m_pFrameStartTimer->stop();
      delete m_pFrameStartTimer;
      m_pFrameStartTimer = NULL;
   }
   
   if (m_pFrameStartCallback)
   {
      #ifdef _WIN32
         delete m_pFrameStartCallback;
         // in linux m_pFrameStartCallback is managed and deleted by OsTimer
      #endif
      m_pFrameStartCallback = NULL;
   }
   
   if (mManagedFlowGraphs.entries() != 0)
   {
      // there shouldn't be any flowgraphs here at this point
      OsSysLog::add(FAC_AUDIO, PRI_WARNING, "MpMediaTask mManagedFlowGraphs is %d, should be 0", (int)mManagedFlowGraphs.entries());
   }

   mManagedFlowGraphs.destroyAll();

   if (mpBufferMsgPool != NULL)
      delete mpBufferMsgPool;

   if (mpSignalMsgPool != NULL)
      delete mpSignalMsgPool;

   spInstance = NULL;
}
// Destructor
SipProtocolServerBase::~SipProtocolServerBase()
{
    mDataGuard.acquire();
    mClientLock.acquireWrite();

    waitUntilShutDown();
    
    int iteratorHandle = mClientList.getIteratorHandle();
    SipClient* client = NULL;
    while ((client = (SipClient*)mClientList.next(iteratorHandle)))
    {
        mClientList.remove(iteratorHandle);
        delete client;
    }
    mClientList.releaseIteratorHandle(iteratorHandle);
    mClientLock.releaseWrite();
    mDataGuard.release();
}
示例#8
0
// Destructor
SipServerBroker::~SipServerBroker()
{
    OsSysLog::add(FAC_SIP, PRI_DEBUG,
                  "SipServerBroker::~ OsSocket %p status %s",
                  mpSocket,
                  mpSocket ? ( mpSocket->isOk() ? "ok" : "not ok" ) : "deleted"
                  );

    if (mpSocket)
    {
        mpSocket->close();
    }
    waitUntilShutDown();
    if (mpSocket)
    {
       delete mpSocket;
       mpSocket = NULL;
    }
}
示例#9
0
// Destructor
HttpServer::~HttpServer()
{
    if(mpServerSocket)
    {
        // Close the server socket to unblock the listener
        mpServerSocket->close();
    }

    // Wait until run exits before clobbering members
    waitUntilShutDown();

    /// mpServerSocket is not deleted - the caller of the constructor owns it

    if(mpValidIpAddressDB)
    {
       delete mpValidIpAddressDB;
       mpValidIpAddressDB = NULL;
       mValidIpAddrList.destroyAll();
    }

    mUriMaps.destroyAll();                 // Delete all of the Url mappings
    mRequestProcessorMethods.destroyAll(); // Delete all of the processor mappings

    if (!mHttpServices.isEmpty())
    {
       UtlHashMapIterator httpServices(mHttpServices);
       UtlString* serviceUri;
       while ((serviceUri = dynamic_cast<UtlString*>(httpServices())))
       {
          delete mHttpServices.removeReference(serviceUri); // remove and delete service path
          // don't delete the value - that is owned by the caller who added it.
       }
    }

    // Delete remaining HttpConnections
    if (mpHttpConnectionList)
    {
        mpHttpConnectionList->destroyAll();
        delete mpHttpConnectionList;
        mpHttpConnectionList = NULL;
    }
}
示例#10
0
// Destructor
SipRefreshManager::~SipRefreshManager()
{
    // Do not delete mpUserAgent ,mpDialogMgr.  They
    // may be used else where and need to be deleted outside the
    // SipRefreshManager.

    // Stop receiving SUBSCRIBE responses
    mpUserAgent->removeMessageObserver(*(getMessageQueue()));

    // Wait until this OsServerTask has stopped or handleMethod
    // might access something we are about to delete here.
    waitUntilShutDown();

    // Delete the event type strings
    mEventTypes.destroyAll();

    // Unsubscribe to anything that is in the list
    stopAllRefreshes();
    // mRefreshes should now be empty
}
示例#11
0
// Destructor
SipRegistrar::~SipRegistrar()
{
   // this is called from the main routine
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipRegistrar::~ waiting for task exit");

   waitUntilShutDown(); // wait for the thread to exit
   
   // all other threads have been shut down
   OsSysLog::add(FAC_SIP, PRI_DEBUG, "SipRegistrar::~ task shut down - complete destructor");

   mPeers.destroyAll();

   mValidDomains.destroyAll();

   // release the registration database instance
   if (mRegistrationDB)
   {
      mRegistrationDB->releaseInstance();
      mRegistrationDB = NULL;
   }
}
示例#12
0
// Destructor
StatusServer::~StatusServer()
{
   waitUntilShutDown();

   // Wait for the owned servers to shutdown first
   if ( mSubscribeServerThread )
   {
      // Deleting a server task is the only way of
      // waiting for shutdown to complete cleanly
      delete mSubscribeServerThread;
      mSubscribeServerThread = NULL;
      mSubscribeServerThreadQ = NULL;
   }
   if ( mSubscribePersistThread)
   {
      delete mSubscribePersistThread;
      mSubscribePersistThread = NULL;
   }
   // HTTP server shutdown
   if (mHttpServer)
   {
      mHttpServer->requestShutdown();
      delete mHttpServer;
      mHttpServer = NULL;
   }

   if (mpServerSocket)
   {
      // already closed by HttpServer
      delete mpServerSocket;
      mpServerSocket = NULL;
   }

   if( mNotifier)
   {
      delete mNotifier;
      mNotifier = NULL;
   }
}
示例#13
0
// Destructor
SipRedirectServer::~SipRedirectServer()
{
   waitUntilShutDown();
}
示例#14
0
 virtual ~SimpleTask() { waitUntilShutDown(); }
示例#15
0
// Destructor
// As part of destroying the task, flush all messages from the incoming
// OsMsgQ.
OsServerTask::~OsServerTask()
{
   waitUntilShutDown(20000);  // upto 20 seconds

   mIncomingQ.flush();    // dispose of any messages in the request queue
}
示例#16
0
// Stop the task properly.
void SipPresenceMonitorPersistenceTask::stop()
{
   waitUntilShutDown();
}
示例#17
0
XCpCall::~XCpCall()
{
   destroySipConnection(); // destroy connection if it still exists
   waitUntilShutDown();
}
示例#18
0
// Destructor
OsTaskLinux::~OsTaskLinux()
{
   waitUntilShutDown();
   doLinuxTerminateTask(FALSE);
}
SipXMessageObserver::~SipXMessageObserver(void)
{
    waitUntilShutDown();
}
示例#20
0
SipClientTls::~SipClientTls()
{
   // Tell the associated thread to shut itself down.
   waitUntilShutDown();
}