You Are Here:

Community: Wiki

This page was last modified on 28 March 2009, at 03:18.

Default iap

From Forum Nokia Wiki

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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia