Logo Search packages:      
Sourcecode: kmess version File versions

P2PApplicationBase::P2PApplicationBase ( ApplicationList applicationList  ) 

Constructor, initializes the P2PApplicationBase instance fields.

The ApplicationList object contains the direct connection, which is shared between all P2P applications of one same contact. This object is also used to deliver messages back to the contact.

Parameters:
applicationList The application list object for the contact

Definition at line 64 of file p2papplicationbase.cpp.

References P2PApplicationBase::UnAckedMessage::ackSessionID, P2PApplicationBase::UnAckedMessage::dataSize, P2PApplicationBase::UnAckedMessage::footerCode, Application::getContactHandle(), P2PApplicationBase::UnAckedMessage::messageID, P2PApplicationBase::UnAckedMessage::messageType, P2P_MSG_UNKNOWN, P2PApplicationBase::UnAckedMessage::sentTime, P2PApplicationBase::UnAckedMessage::sessionID, slotApplicationListDeleted(), slotCleanup(), and P2PApplicationBase::UnAckedMessage::totalSize.

: Application( applicationList->getContactHandle() ),
  applicationList_(applicationList),
  buffer_(0),
  dataSource_(0),
  dataType_(P2P_TYPE_NEGOTIATION),
  fragmentMessageID_(0),
  fragmentOffset_(0),
  fragmentTotalSize_(0),
  nextMessageID_(0),
  shouldSendAck_(false),
  userAborted_(false),
  waitingState_(P2P_WAIT_DEFAULT)
{
  // For debugging
  setObjectName( QLatin1String( metaObject()->className() ) + "[0/" + getContactHandle() + "]" );

  // Reset other internal fields
  lastIncomingMessage_.dataSize     = 0;
  lastIncomingMessage_.messageID    = 0;
  lastIncomingMessage_.messageType  = P2P_MSG_UNKNOWN;
  lastIncomingMessage_.sentTime     = 0;
  lastIncomingMessage_.sessionID    = 0;
  lastIncomingMessage_.totalSize    = 0;
  lastIncomingMessage_.ackSessionID = 0;
  lastIncomingMessage_.footerCode   = 0;

  // Initiaize the timer
  waitingTimer_ = new QTimer(this);
  waitingTimer_->setSingleShot( true );
  connect( waitingTimer_, SIGNAL(timeout()), this, SLOT(slotCleanup()) );

  // Crash prevention.
  connect( applicationList_, SIGNAL(destroyed()), this, SLOT(slotApplicationListDeleted()) );
}


Generated by  Doxygen 1.6.0   Back to index