Logo Search packages:      
Sourcecode: kmess version File versions

bool P2PApplicationBase::sendP2PAck (  )  [protected, inherited]

Send an ACK message if this is needed.

This method called each time a P2P payload is fully received (such as an SLP message). The ACK system turns the P2P communication into a stop-and-wait protocol. The other client waits until it receives an ACK or error before it continues with the next step.

This function is mostly used by the derived P2PApplication class. It calls sendP2PAck() when a SLP message is properly received.

Returns:
Whether an ack had to be sent.

Definition at line 1536 of file p2papplicationbase.cpp.

References P2PApplicationBase::sendP2PAckImpl().

Referenced by P2PApplication::gotDataPreparation(), P2PApplication::gotSlpAck(), P2PApplication::gotSlpBye(), P2PApplication::gotSlpInvite(), P2PApplication::gotSlpOk(), P2PApplication::gotSlpStatus(), and P2PApplication::sendSlpError().

{
  // Only send an ACK is this is really needed.
  if( ! shouldSendAck_ )
  {
#ifdef KMESSDEBUG_P2PAPPLICATION_GENERAL
    kDebug() << "NOTICE: not sending 0x02 ack packet, something is already sent (or nothing needs to be sent).";
#endif

    return false;
  }

  // Send the ack
  sendP2PAckImpl();  // type = P2PMessage::MSN_FLAG_ACK.
  return true;
}


Generated by  Doxygen 1.6.0   Back to index