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

void Connection::stop_file_transmission (  ) 

called to stop sending of the current file, will block until file is really finished

If you stop the file transmission manually, CallInterface::transferCompleted won't be called.

Definition at line 886 of file connection.cpp.

References buffers_used, debug, debug_level, file_to_send, prefix(), and send_mutex.

Referenced by disconnect_b3_ind(), FaxSend::mainLoop(), AudioSend::mainLoop(), and ~Connection().

{
      if (debug_level >= 2) {
            debug << prefix() << "stop_file_transmission initiated" << endl;
      }
      pthread_mutex_lock(&send_mutex);
      if (file_to_send) {
            file_to_send->close();
            delete file_to_send;
            file_to_send=NULL;
      }
      pthread_mutex_unlock(&send_mutex);

      timespec delay_time;
      delay_time.tv_sec=0; delay_time.tv_nsec=100000000;  // 100 msec
      while (buffers_used) // wait until all packages are transmitted
            nanosleep(&delay_time,NULL);
      if (debug_level >= 2) {
            debug << prefix() << "stop_file_transmission finished" << endl;
      }
}


Generated by  Doxygen 1.6.0   Back to index