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

void P2PApplication::slotCleanup (  )  [private, slot]

Cleanup function, is called if we never received the data we were waiting for.

Definition at line 2051 of file p2papplication.cpp.

References sendCancelMessage().

Referenced by P2PApplication().

{
#ifdef KMESSTEST
  ASSERT( waitingState_ != P2P_WAIT_DEFAULT );
#endif

  // Tell the other client we were waiting for a message to receive!
  sendCancelMessage(CANCEL_TIMEOUT);   // MSN_FLAG_WAITING message

  // Important note:
  // Each case calling endApplication() contains a "return;"
  // All debug cases use "break;" so the final endApplication() is called.

  // Put a message at the console
  switch(waitingState_)
  {
    case P2P_WAIT_CONTACT_ACCEPT:
    {
#ifdef KMESSDEBUG_P2PAPPLICATION_GENERAL
      kdDebug() << "P2PApplication: Contact didn't accept the invitation, terminating manually." << endl;
#endif

      endApplication( i18n("The invitation was cancelled.  A timeout occured waiting for the contact to accept.") );
      return;
    }

    case P2P_WAIT_FOR_SLP_OK_ACK:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for SLP OK ACK (contact=" << contactHandle_ << ")." << endl;
      break;
    }

    case P2P_WAIT_FOR_PREPARE:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for data-preparation message (contact=" << contactHandle_ << ")." << endl;
      break;
    }

    case P2P_WAIT_FOR_PREPARE_ACK:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for data-preparation ACK (contact=" << contactHandle_ << ")." << endl;
      break;
    }

    case P2P_WAIT_FOR_FILE_DATA:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for file data transfer (contact=" << contactHandle_ << ")." << endl;
      break;
    }

    case P2P_WAIT_FOR_SLP_BYE:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for BYE message (contact=" << contactHandle_ << ")." << endl;
      endApplication(); // No message required, already got what we wanted
      return;
    }

    case P2P_WAIT_FOR_SLP_BYE_ACK:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for BYE-ACK (contact=" << contactHandle_ << ")." << endl;
      endApplication(); // No message required, already got what we wanted
      return;
    }

    case P2P_WAIT_FOR_SLP_ERR_ACK:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for SLP Error-ACK (contact=" << contactHandle_ << ")." << endl;
      endApplication(); // No message required, already got what we wanted
      return;
    }

    case P2P_WAIT_FOR_CLOSING_ACK:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for closing-ACK (contact=" << contactHandle_ << ")." << endl;
      endApplication(); // No message required, already got what we wanted
      return;
    }

    default:
    {
      kdDebug() << "P2PApplication: WARNING - Timeout waiting for ...? (contact=" << contactHandle_ << ")" << endl;
    }
  }

  endApplication( i18n("The invitation was cancelled.  A timeout occured waiting for data.") );
}


Generated by  Doxygen 1.6.0   Back to index