// ----------------------------------------------------------------------------- // CSIPClientDiscoveryReceiver::RunL // ----------------------------------------------------------------------------- // void CSIPClientDiscoveryReceiver::RunL() { TInt err = iStatus.Int(); if (err == KErrServerTerminated) { // This will leave to RunError-function. See below. User::Leave(err); } if (err == KErrNone) { switch (iClientResolved()) { case ESIPCRChannelComplete: HandleChannelResolvedL(); break; case ESIPCRClientNotFound: HandleClientNotFoundL(); break; default: break; } } else { ErrorOccured(err); } ReceiveNext (); }
// ----------------------------------------------------------------------------- // CSIPClientDiscoveryReceiver::RunError // ----------------------------------------------------------------------------- // TInt CSIPClientDiscoveryReceiver::RunError(TInt aError) { if (aError == KErrServerTerminated) { // Return the error to the active scheduler and stop receiving. // Receiving must be stopped. // It would lead to infinite RunL-RunError-loop. return aError; } // Ignore all the other errors and continue receiving ReceiveNext (); return KErrNone; }
// ----------------------------------------------------------------------------- // CSIPClientDiscoveryReceiver::CSIPClientDiscoveryReceiver // ----------------------------------------------------------------------------- // CSIPClientDiscoveryReceiver::CSIPClientDiscoveryReceiver ( MSIPClientDiscoveryITC& aITC, MSIPClientDiscoveryObserver& aObserver, CSIPClientDiscoverySerializer& aSerializer) : CActive (EPriorityStandard), iObserver (aObserver), iSerializer (aSerializer), iITC(aITC) { CActiveScheduler::Add (this); iITCMsgArgs.Set(ESIPCRIpcArgReqId, &iIdsPckg); iITCMsgArgs.Set(ESIPCRIpcArgClientResolved, &iClientResolved); iITCMsgArgs.Set(ESIPCRIpcArgBufSizes, &iSizesPckg); iITCMsgArgs.Set(ESIPCRIpcArgResolverUid, &iResolverUid); ReceiveNext(); }
int CAsyncSocketExLayer::Receive(void* lpBuf, int nBufLen, int nFlags /*=0*/) { int Result = ReceiveNext(lpBuf, nBufLen, nFlags); return Result; }