Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Default iap

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: vasant21 (21 Apr 2007)
Last edited: hamishwillee (20 Jul 2012)

For selecting default IAP for 2nd and 3rd edition.


Hearders Required:

#include <Es_sock.h> //,RConnection ,RSocketServ 
#include <Commdbconnpref.h> //TCommDbConnPref
#include <stringpool.h> //RStringPool
#include <http\rhttpconnectioninfo.h> //RHTTPConnectionInfo

Library required:

LIBRARY efsrv.lib //RSocketServ 
LIBRARY esock.lib //RDbNamedDatabase,RDbView
LIBRARY bafl.lib //RStringPool
LIBRARY http.lib //RHTTPConnectionInfo

Source:

Place the code below after iSession.OpenL()

User::LeaveIfError(isockServ.Connect());
User::LeaveIfError(iconnection.Open(isockServ));
 
// TCommDbConnPref pref;
TUint32 m_Iap=0;
pref.SetIapId(m_Iap);
pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
pref.SetDirection(ECommDbConnectionDirectionOutgoing);
pref.SetBearerSet( ECommDbBearerGPRS | ECommDbBearerCdma2000
| ECommDbBearerLAN | ECommDbBearerCSD );
 
iconnection.Start(pref);
 
RStringPool strP = iSession.StringPool();
RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();
connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ,
RHTTPSession::GetTable() ), THTTPHdrVal (isockServ.Handle()) );
TInt connPtr = REINTERPRET_CAST(TInt, &iconnection);
connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection,
RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );

Declare RSocketServ isockServ and RConnection iconnection as class members.


See also

This page was last modified on 20 July 2012, at 09:49.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×