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

void Connection::data_b3_conf ( _cmsg &  message  )  throw (CapiError,CapiWrongState, CapiMsgError, CapiExternalError) [protected]

called when we get DATA_B3_CONF from CAPI

This will trigger new send_block().

Parameters:
message the received DATA_B3_CONF message
Exceptions:
CapiWrongState Thrown when the message is received unexpected (i.e. in a wrong plci_state)
CapiMsgError Thrown if the info InfoElement indicates an error
CapiError Thrown when an invalid message is received and by Connection::send_block()
CapiExternalError Thrown by Connection::send_block()

Definition at line 713 of file connection.cpp.

References buffer_start, buffers_used, file_to_send, NACT, ncci, ncci_state, send_block(), and send_mutex.

{
      if (ncci_state!=NACT)
            throw CapiWrongState("DATA_B3_CONF received in wrong state","Connection::data_b3_conf()");

      if (ncci!=DATA_B3_CONF_NCCI(&message))
            throw CapiError("DATA_B3_CONF received with wrong NCCI","Connection::data_b3_conf()");

      if (DATA_B3_CONF_INFO(&message))
            throw CapiMsgError(DATA_B3_CONF_INFO(&message),"DATA_B3_CONF received with Error (Info)","Connection::data_b3_conf()");

      pthread_mutex_lock(&send_mutex);

      try {
            if ( (!buffers_used) || (DATA_B3_CONF_DATAHANDLE(&message)!=buffer_start) )
                  throw CapiError("DATA_B3_CONF received with invalid data handle","Connection::data_b3_conf()");
            // free one buffer
            buffers_used--;
            buffer_start=(buffer_start+1)%7;
            while (file_to_send && (buffers_used < conf_send_buffers) )
                  send_block();
      }
      catch (...) {
            pthread_mutex_unlock(&send_mutex);
            throw;
      }
      pthread_mutex_unlock(&send_mutex);
}


Generated by  Doxygen 1.6.0   Back to index