Title: Access Point in the active status

Source: Internet
Author: User

Tss000467
Development partner platform:
S60 2nd edition, s60 2nd Edition FP1, fp2, and fp3
S60 3rd edition, s60 3rd edition FP1
Detailed description
In the following situations, a dialog box is displayed, prompting you to select an access point, for example:

Code:

 
-Initiating an HTTP connection-downloading a file with Download Manager API-opening a URL in browser control API

You can reuse the current access point. When you open an HTTP link and use the Download Manager API to start downloading a file, you will see this situation. Repeated use can prevent the access point prompt dialog box from appearing twice.

Solution

Mconnectionmonitorobserver is a monitoring class that can monitor Connection events such as generating or deleting a connection or IAP change events. ClientProgramYou must complete its interface to receive Processing notifications.

The steps are as follows:

1) inherit from mconnectionmonitorobserver and complete the eventl () callback method:

Code:

Class cmyhttpengine: Public mconnectionmonitorobserver {... public: // from mconnectionobserver void eventl (constCconmonevenbase& Aconnevent);... private: rconnectionmonitor iconnmon ;};

2) register before allowing users to use an HTTP connection to get Event Notifications:

Code:

 
Tint err = iconnmon. connectl (); iconnmon. policyeventl (* This );//... Proceed to open HTTP Connection

3) process the received events and check the ID of the active IAP.

Code:

 cmyhttpengine: eventl (const  cconmonevenbase  & aconnevent) {tint event = aconnevent. eventtype (); tuint connid = aconnevent. connectionid (); tuint iapid; trequeststatus status; Switch (event) {Case econnmoncreateconnection: // new connection created {// cast aconnevent to cconnmoncreateconnection if needed iconnmon. getuintattribute (connid, 0, kiapid, iapid, status); // name of AP can be retrieved with // getstringattribute (connid, 0, kiapname ,...) user: waitforrequest (Status); break;} case econnmoncreatesubconnection: // subconnection to an existing AP {tuint subconnid; // cast aconnevent to cconnmoncreatesubconnection if needed  const cconnmoncreatesubconnection subconnevent =  
(Cconnmoncreatesubconnection) aconnevent;
 
// There is an error in this sentence. I don't know how to solve it yet.
 
// Function call '[cconnmoncreatesubconnection].
 
// Cconnmoncreatesubconnection ({lval} const cconnmoneventbase) 'does not matchSubconnid = subconnevent. subconnectionid (); iconnmon. getuintattribute (connid, subconnid, kiapid, iapid, status); // name of AP can be retrieved with // getstringattribute (connid, subconnid, kiapname ,...) user: waitforrequest (Status); break;} default: break;} // close the monitor when Event Notifications are no longer required // iconnmon. close ();}

We can monitor whether the access point can be accessed, whether it is deleted, and whether its status is changed.

Cconmonevenbase is incorrect. It should beCconnmonevenbase 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.