void CTcpSymbianEngine::StartLookupL() { DBG("StartLookupL"); SetEngineState(ELookingUp); // Initiate DNS if(KErrNone == #if defined NAV2_CLIENT_SERIES60_V3 && !defined __WINS__ && !defined __WINSCW__ iResolver.Open(iSocketServ, KAfInet, KProtocolInetUdp, iConnection) #else iResolver.Open(iSocketServ, KAfInet, KProtocolInetUdp) #endif ){ if(KErrNone == iDNSCache.CacheHostLookup(*iHostName, iNameEntry, iPort)){ DBG("Host found in cache"); CompleteSelf(KErrNone); } else { DBG("Host not found in cache, looking up in DNS"); // DNS request for name resolution iResolver.GetByName(*iHostName, iNameEntry, iStatus); SetActive(); } // Request time out iTimer->After(iTimeOut); //signal state iConsole.ConnectionNotify(isab::Module::CONNECTING, isab::Module::REQUESTED); DBG("Starting asynchronous name lookup"); } else { WARN("Lookup failed"); ResetL(ELookUpFailed, isab::Module::LOOKUP_FAILED); } }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::SetNextURIL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::SetNextURIL( const TDesC8& aURI, const CUpnpItem& aItem ) { ResetL(); iCommandActive->SetNextURIL( aURI, aItem ); }
void CTcpSymbianEngine::ResetL(enum TEchoEngineState aDuring, enum isab::Module::ConnectionNotifyReason aReason) { SetEngineState(aDuring); iConsole.ConnectionNotify(isab::Module::DISCONNECTING, aReason); ResetL(aDuring); }
void CPopsTestHarness::TestLocalCopyL(const TDesC& aPassText, const TDesC& aFailText) // ------------------------------------------------------------------ // Test Copying from a Local folder to another Local Folder // ------------------------------------------------------------------ { iTestError = 0; iTestNumber++; // Reset the harness & run the Test iTestUtils->FileSession().Delete(KMsvTestFillDiskFile); ResetL(); iTestUtils->TestStart(iTestNumber); TRAPD(error, DoLocalCopyTestL()); // Delete the fill file, so we can write to the log iTestUtils->FileSession().Delete(KMsvTestFillDiskFile); if (error == KErrDiskFull) { // Test OK = We could not Copy, as the disk was too Full iTestUtils->WriteComment(aPassText); } else if (error == KErrNone) { // ERROR - The Copy completed, even though the Disk was Full iTestUtils->WriteComment(aFailText); iTestError = KErrGeneral; } EndTestL(); }
void CPopsTestHarness::SetUpTestL(const TDesC& aScriptFile) { // Delete any old dummy fill files iTestUtils->FileSession().Delete(KMsvTestFillDiskFile); // Reset & Copy the script file before filling the Disk ResetL(); CopyScriptFileL(aScriptFile); }
/** Reads the URI list from the server. The server stream handle is already setup. */ TInt CUriListReadStream::ReadUriListL () { // Reset the stream ResetL (); TPtr8 ptr ( iIpcBuffer->Ptr(0) ); TInt result = iListSession.ReadQueryResults ( iHandle, ptr ); User::LeaveIfError ( result ); return result; }
// --------------------------------------------------------------------------- // Destructor // --------------------------------------------------------------------------- // CLbtRamTriggersClientSIDTree::~CLbtRamTriggersClientSIDTree() { TRAPD(err, ResetL()); if( KErrNone != err ) { // TODO: Log warning message that entries could not be deleted } delete iTriggerList; delete iPool; }
/* ------------------------------------------------------------------------------- Class: COomTestHarness Method: ConstructL Description: Symbian 2nd phase constructor that can leave. Note: If OOM test case uses STIF Logger, then STIF Logger must be created with static buffer size parameter (aStaticBufferSize). Otherwise Logger allocates memory from heap and therefore causes error situations with OOM testing. For more information about STIF Logger construction, see STIF Users Guide. Parameters: None Return Values: None Errors/Exceptions: None Status: Approved ------------------------------------------------------------------------------- */ void COomTestHarness::ConstructL() { //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; TInt ret = settingServer.Connect(); if(ret != KErrNone) { User::Leave(ret); } // Struct to StifLogger settigs. TLoggerSettings loggerSettings; // Parse StifLogger defaults from STIF initialization file. ret = settingServer.GetLoggerSettings(loggerSettings); if(ret != KErrNone) { User::Leave(ret); } // Close Setting server session settingServer.Close(); iAddTestCaseTitleToLogName = loggerSettings.iAddTestCaseTitle; // Constructing static buffer size logger, needed with OOM testing because // normally logger allocates memory from heap! iStdLog = CStifLogger::NewL( KT_OomHarnessLogPath, KT_OomHarnessLogFile, CStifLogger::ETxt, CStifLogger::EFile, ETrue, ETrue, ETrue, EFalse, ETrue, EFalse, 100 ); iLog = iStdLog; // Sample how to use logging _LIT( KLogInfo, "t_oomharness logging starts!" ); iLog->Log( KLogInfo ); User::LeaveIfError(iAllocServer.Connect()); User::LeaveIfError(iOomSession.Connect()); User::LeaveIfError(iChunk.CreateLocal(KOomHarnessInitialEatenMemory, KOomHarnessMaxEatenMemory)); iChunkSize = KOomHarnessInitialEatenMemory; iScheduler = new (ELeave) CActiveScheduler; CActiveScheduler::Install( iScheduler ); iStatusWatcher = CMemoryMonitorStatusWatcher::NewL(); iTimeoutWatcher = CMemoryMonitorTimeoutWatcher::NewL(); ResetL(); }
void COggVorbisFile::CBody::ConstructL() { #ifdef SEP_HEAP User::LeaveIfError(iVorbisChunk.CreateLocal(0x4000, 0x20000, EOwnerThread)); iVorbisHeap = User::ChunkHeap(iVorbisChunk, 0x2000); iDefaultHeap = &User::Heap(); #endif ResetL(); }
void CVBookmarkConverter::ImportDbItemL( const CFolderItem& aItem ) { ResetL(); if( aItem.IsFolder() ) { User::Leave( KErrNotSupported ); } SetVersionL( KVBMKVer ); SetUrlL( aItem.SourceUrl() ); SetInternetShortcutL( aItem.SourceUrl() ); SetTitleL( aItem.Name() ); }
void CVBookmarkConverter::ImportDbItemL( const CFavouritesItem& aItem ) { ResetL(); if( aItem.Type() != CFavouritesItem::EItem ) { User::Leave( KErrNotSupported ); } SetVersionL( KVBMKVer ); SetUrlL( aItem.Url() ); SetInternetShortcutL( aItem.Url() ); SetTitleL( aItem.Name() ); }
/** Implements CAnimator::DataEventL.*/ void CBitmapAnimator::DataEventL(TInt aEvent, TAny* aData, TInt aDataLength) { switch (aEvent) { case EBitmapAnimationNewFrame: __ASSERT_ALWAYS(aDataLength==sizeof(CAnimationFrame::THandles),User::Leave(KErrArgument)); AppendFrameL(*static_cast<CAnimationFrame::THandles*>(aData)); break; case EBitmapAnimationComplete: InitialisedL(); break; case EAnimationDataChanged: ResetL(); break; default: break; } }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::ReleaseLocalMSServicesL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::ReleaseLocalMSServicesL() { ResetL(); iCommandActive->ReleaseLocalMSServicesL(); }
TInt CVBookmarkConverter::ImportVBookmarkL( const TDesC8& aBuffer ) { LOGGER_ENTERFN( "CVBookmarkConverter::ImportVBookmarkL" ); ResetL(); TInt error = KErrNone; TInt position = 0; TPtrC8 tag; TPtrC8 value; TPtrC8 properties; error = ReadTagAndValue( aBuffer, position, tag, value, properties ); if( error != KErrNone ) { LOGGER_WRITE_1( "ReadTagAndValue err: %d", error ); return error; } if ( ( tag != KVBMKBegin ) || ( value != KVBMKVbkm ) ) { LOGGER_WRITE( "Invalid tag" ); return KErrNotFound; } while ( ( error = ReadTagAndValue( aBuffer, position, tag, value, properties ) ) == KErrNone ) { // Version if ( tag == KVBMKVersion ) { SetVersionL( value ); } // Url else if ( tag == KVBMKUrl ) { SetUrlL( value ); } // Title else if ( tag == KVBMKTitle ) { TBookmarkEncoding encoding = Encoding( properties ); SetTitleL( value, encoding ); } // Beginning of envelope else if ( ( tag == KVBMKBegin ) && ( value == KVBMKEnv ) ) { // Read the envelope, quit if error error = ReadEnvelopeL( aBuffer, position ); if( error != KErrNone ) { return error; } } // End of Bookmark else if ( ( tag == KVBMKEnd ) && ( value == KVBMKVbkm ) ) { return error; } else { // Unknown data, skip } } LOGGER_LEAVEFN( "CVBookmarkConverter::ImportVBookmarkL" ); return error; }
void CTcpSymbianEngine::RunL() { DBG("RunL, EngineState: %d, iStatus: %d", EngineState(), iStatus.Int()); iTimer->Cancel(); // Cancel TimeOut timer before handling completion switch(EngineState()){ case EConnecting: // IP connection request if (iStatus == KErrNone){ DBG("Connection completed Ok"); // Connection completed sucessfully iConsole.ConnectionNotify(isab::Module::CONNECTED, isab::Module::REQUESTED); SetEngineState(EConnected); Read(); //Start CTcpSymbianRead Active object } else { WARN("Unable to connect, removing host from cache."); iDNSCache.Remove(*iHostName); if (iStatus == KErrCouldNotConnect){ ResetL(EConnectFailed, isab::Module::NO_RESPONSE); } else if (iStatus == KErrTimedOut) { ResetL(ETimedOut, isab::Module::NO_RESPONSE); } else{ WARN("EConnectFailed, INTERNAL_ERROR"); ResetL(EConnectFailed, isab::Module::INTERNAL_ERROR); //XXX handle the different cases } } break; case ELookingUp: iResolver.Close(); if (iStatus == KErrNone) { DBG("Name lookup ok"); // DNS look up successful // Extract domain name and IP address from name record class TInetAddr addr = TInetAddr::Cast(iNameEntry().iAddr); //cache the ip for later. TInt cacheStat = iDNSCache.CacheHost(*iHostName, addr.Address()); DBG("Host cached with result %d", cacheStat); cacheStat = cacheStat; // And connect to the IP address Connect(addr.Address(), iPort); //setactive here } else { //includes KErrTimedOut WARN("Lookup failed"); ResetL(ELookUpFailed, isab::Module::LOOKUP_FAILED); } break; case ELinking: if(iStatus == KErrNone){ DBG("Link layer setup ok"); OpenSocketL(); //cannot open socket until here. We need RConnection. StartLookupL(); //setactive here } else { //includes KErrCanceled and KErrTimedOut WARN("Link layer setup failed"); ResetL(ELinkFailed, isab::Module::TRANSPORT_FAILED); } break; case EBroken: DBG("Broken"); ResetL( EngineState(), isab::Module::CHANNEL_FAILED ); break; case EClosing: if(iStatus == KErrNone){ DBG("Closing ok"); ResetL(EComplete, isab::Module::REQUESTED); } else if(iStatus == KErrTimedOut){ ResetL(ETimedOut); } else { ResetL(EngineState()); //XXX ??? } break; case ESwitching: if(iStatus == KErrNone){ //the connection has been closed, start a new connection //using the values in iHostName, iPort, and iIAP. SetEngineState(EComplete); ConnectL(); } else if(iStatus == KErrTimedOut){ ResetL(ETimedOut); } else { ResetL(EngineState()); } break; case EClosed: DBG("Closed"); ResetL( EngineState(), isab::Module::BY_PEER ); break; default: ERR("PANIC KEchoEngine EBadEngineState (%d)", TInt(EBadEngineState)); User::Panic(KEchoEngine, EBadEngineState); break; }; if(!IsActive()){ DBG("Signal OperationComplete"); iConsole.OperationComplete(); DBG("Signaled OperationComplete"); } }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::GetMuteL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::GetMuteL() { ResetL(); iSettingActive->GetMuteL(); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::GetPositionInfoL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::GetPositionInfoL() { ResetL(); iSettingActive->GetPositionInfoL(); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::SetMuteL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::SetMuteL( TBool aMute ) { ResetL(); iSettingActive->SetMuteL( aMute ); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::SetVolumeL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::SetVolumeL( TInt aVolumeLevel ) { ResetL(); iSettingActive->SetVolumeL( aVolumeLevel ); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::PauseL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::PauseL() { ResetL(); iCommandActive->PauseL(); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::StopL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::StopL() { ResetL(); iCommandActive->StopL(); }
// -------------------------------------------------------------------------- // CUPnPAVRenderingSessionImpl::CancelReserveLocalMSServicesL // See upnpavrenderingsessionimpl.h // -------------------------------------------------------------------------- void CUPnPAVRenderingSessionImpl::CancelReserveLocalMSServicesL() { ResetL(); iCommandActive->CancelReserveLocalMSServicesL(); }