Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 14:40, 7 May 2008.

Exiting a program which is waiting on a request

From Forum Nokia Wiki

Many a times it happens that a user terminates a program which has actually sent a request for a service. Ideally if an Exit command is fired the pending request should be cancelled and then the program should be terminated. But in some cases the pending request takes a considerable amount of time to be cancelled. For e.g. a Bluetooth discovery request

void CDeviceDiscoverer::DiscoverDevicesL(TDeviceDataList* aDevDataList)
	{
 
	iDiscoveredDeviceCount=0;
	// wipe existing device data list, start fresh
	iDevDataList=aDevDataList;
	iDevDataList->Reset();
 
	// load protocol for discovery
	TProtocolDesc pdesc;
	User::LeaveIfError(iSocketServ.FindProtocol(KBTLinkManagerTxt(), pdesc));
 
	// initialize host resolver
	User::LeaveIfError(iResolver.Open(iSocketServ, pdesc.iAddrFamily, 
         pdesc.iProtocol));
 
	// start device discovery by invoking remote address lookup
	iAddr.SetIAC(KGIAC);
	iAddr.SetAction(KHostResInquiry|KHostResName|KHostResIgnoreCache);
	iResolver.GetByAddress(iAddr, iEntry, iStatus);
	SetActive();
	}

does not end fast with a call to Cancel().

In such one option is to show a wait note.

Other workaround is to send the application to the background and exit once the request has been canceled or the request is completed.

Related Discussions
Thread Thread Starter Forum Replies Last Post
pys60, irda and remote control cassioli Python 5 2008-06-10 14:19
Mobile File System Security omarahmed9 Mobile Java General 6 2008-06-06 12:24
Problem with Digital signature celmon Mobile Java General 3 2007-04-02 11:24
Getting rid of notification dialogs when starting and exiting a j2me app? ttmyks Mobile Java General 1 2007-08-16 21:00
View from Container? ManuMies General Symbian C++ 6 2007-11-21 14:39
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZbluetoothQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX