×
Namespaces

Variants
Actions

Default iap

From Nokia Developer 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 12:49.
49 page views in the last 30 days.
×