Logo Search packages:      
Sourcecode: capisuite version File versions  Download package

Connection::~Connection (  ) 

. Destructor. Deletes the connection object.

Can block if file transmission is still in progress and/or if connection is not cleared already.

Please call as soon as you don't need the object any more as this will also free some CAPI resources associated to the call.

Please disconnect before deleting a Connection object! The auto-disconnect here is only supported to prevent fatal errors and won't work very nicely!!

Definition at line 150 of file connection.cpp.

References debug, debug_level, disconnectCall(), DOWN, error, fax_info, getState(), P0, PHYSICAL_ONLY, plci_state, prefix(), receive_mutex, send_mutex, stop_file_reception(), and stop_file_transmission().

{
      stop_file_transmission();
      stop_file_reception();

      if (getState()!=DOWN) {
            error << prefix() << "WARNING: please disconnect yourself before deleting connection object!!" << endl;
            disconnectCall(PHYSICAL_ONLY);
            while (getState()!=DOWN)
                  ;
      }
      plci_state=P0;

      pthread_mutex_lock(&send_mutex);  // assure the lock is free before destroying it
      pthread_mutex_unlock(&send_mutex);
      pthread_mutex_destroy(&send_mutex);

      pthread_mutex_lock(&receive_mutex); // assure the lock is free before destroying it
      pthread_mutex_unlock(&receive_mutex);
      pthread_mutex_destroy(&receive_mutex);

      if (fax_info)
            delete fax_info;

      if (debug_level >= 1) {
            debug << prefix() << "Connection object deleted" <<  endl;
      }
}


Generated by  Doxygen 1.6.0   Back to index