本文整理汇总了C++中TCommDbConnPref类的典型用法代码示例。如果您正苦于以下问题:C++ TCommDbConnPref类的具体用法?C++ TCommDbConnPref怎么用?C++ TCommDbConnPref使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TCommDbConnPref类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupL
void UT_CRtpComm::SetupL( )
{
iTimer = CPeriodic::NewL( EPriorityNormal );
iErr=0;
TCommDbConnPref prefs;
prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
prefs.SetDirection( ECommDbConnectionDirectionOutgoing );
prefs.SetIapId( KDefaultIap );//6
TInt err( KErrCouldNotConnect );
// Opens a session to the socket server
// i.e. creates an IPC communication channel to the socket server
if ( ( err = iSocketServ.Connect() ) != KErrNone )
{
EUNIT_ASSERT( err==KErrNone );
}
// Opens a new RConnection instance
else if (( err = iConnection.Open( iSocketServ )) != KErrNone )
{
iConnection.Close();
EUNIT_ASSERT( err==KErrNone );
}
else if (( err = iConnection.Start( prefs )) != KErrNone )
{
iConnection.Close();
EUNIT_ASSERT( err==KErrNone );
}
}
示例2: new
void UT_MNATFWMediaWrapper::Setup2L()
{
iWaitScheduler = new(ELeave) CActiveSchedulerWait();
iMediaConnWrapper = CNATFWSocketMediaConnWrapper::NewL(
KTcpPort, KProtocolInetTcp, KStreamId );
User::LeaveIfError( iSocketSrv.Connect() );
// Open an RConnection object. Note that you must provide an RSocketServ object
User::LeaveIfError( iConn.Open( iSocketSrv ) );
TCommDbConnPref pref;
pref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
pref.SetIapId( /*6*/10 );
// Start an Outgoing Connection
iConn.Start( pref, iStatus );
User::WaitForRequest( iStatus );
User::LeaveIfError( iStatus.Int() );
iMediaConnWrapper->RegisterMediaWrapperObserverL( this, iSocketSrv, iWrapperLocalAddr );
iSocketMediaConnWrapper = iMediaConnWrapper;
iMediaWrapper = iMediaConnWrapper;
iConn.Close();
}
示例3: Log
TBool CAppMain::GetState(){
Log(_L8("CAppMain::GetState() begin"));
TBool r=ETrue;
if(iFirstConnect){
iSocketServ.Connect();
TCommDbConnPref prefs;
//有些手机需要搜索接入点
prefs.SetIapId(iDefaultAccessPointID);
if(0==iConnection.Open(iSocketServ)){
//提示用户选择接入点
Log(_L8("CAppMain::GetState(): Hint user to select the access point"));
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
TInt err=0;
#ifndef _MANUALAPN_
Log(_L8("err=iConnection.Start(prefs);"));
err=iConnection.Start(prefs);
#else
Log(_L8("err=iConnection.Start();"));
err = iConnection.Start();
#endif
if(0==err){
iFirstConnect=EFalse;
return ETrue;
}
r=EFalse;
}
}
Log(_L8("CAppMain::GetState() end"));
return r;
}
示例4: new
void UT_CNATFWUNSAFServerQuery::SetupL()
{
iResultArray = new (ELeave) RArray<TInetAddr>;
User::LeaveIfError(iServer.Connect(KESockDefaultMessageSlots));
User::LeaveIfError(iConnection.Open(iServer, KConnectionTypeDefault));
TCommDbConnPref prefs;
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
prefs.SetIapId(10);
User::LeaveIfError(iConnection.Start(prefs));
iHostResolver = CNATFWUNSAFHostResolver::NewL(iServer, iConnection);
iObserver = UT_CNATFWUNSAFServerResolverObserverStub::NewL();
CNATFWUNSAFQueryData* query = CNATFWUNSAFQueryData::NewL(
iObserver,
5060,
_L8("udp"),
_L8("testi.net"),
_L8("stun"),
*iHostResolver,
*iResultArray );
CleanupStack::PushL(query);
iServerQuery = CNATFWUNSAFServerQuery::NewL( iObserver, query );
CleanupStack::Pop( query );
}
示例5: SetupL
void UT_CNATFWUNSAFUdpSender::SetupL()
{
User::LeaveIfError( iServer.Connect( 8 ) );
User::LeaveIfError( iConn.Open( iServer, KConnectionTypeDefault ) );
TCommDbConnPref prefs;
prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
prefs.SetDirection( ECommDbConnectionDirectionOutgoing );
prefs.SetIapId(10);
User::LeaveIfError( iConn.Start( prefs ) );
User::LeaveIfError( iSocket.Open( iServer,
KAfInet,
KSockDatagram,
KProtocolInetUdp,
iConn ) );
iMsg = NATFWUNSAFTransportTestUtils::CreateUNSAFBindingRequestL();
iAddr = TInetAddr( INET_ADDR( 127, 0, 0, 1 ) );
iSender = CNATFWUNSAFUdpSender::NewL( iSocket, *this );
iIsMsgSent = EFalse;
}
示例6: StartIAP
/**
* Function that opens and starts an RConnection.
*/
TInt CPanConnections::StartIAP()
{
TInt rerr = KErrNone;
// Create a set of connection preferences to override existing
// set in CommDb when RConnection::Start is called.
TCommDbConnPref connPref;
PanProfileIAPs iap(EGeneralIAP);
connPref.SetIapId(iap);
connPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
// load BT stack
rerr = Initialise();
if(rerr == KErrNone)
{
// Open the connection
rerr = iConnection.Open(iSockSvr);
if(rerr == KErrNone)
{
// Start the connection
// use the iStatus of active object, if it doesn't complete (we are listening)
// then the active object deals with it, otherwise AO calls IapStarted function on this class
// Something wrong with RConnection start
iActiveMode = EIAPStart;
iConnection.Start(connPref, iStatus);
SetActive();
iIapLoading = ETrue;
}
}
return rerr;
}
示例7: SetIap
TInt CResourceManager::SetIap(TUint32 aIapId, TBool aIsWap)
{
m_bUseOutNetSettting = false;
m_socketServ.Connect();
m_connection.Open(m_socketServ);
m_iapId = aIapId;
m_isWap = aIsWap;
TInt err = KErrNone;
// Now we have the iap Id. Use it to connect for the connection.
// Create a connection preference variable.
TCommDbConnPref connectPref;
// setup preferences
connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
connectPref.SetBearerSet(ECommDbBearerGPRS | ECommDbBearerWLAN | ECommDbBearerLAN);
//Sets the CommDb ID of the IAP to use for this connection
connectPref.SetIapId(aIapId);
err = m_connection.Start(connectPref);
if (err == KErrNone) {
m_IAPSeted = true;
m_IAPReady = true;
ResendRequest();
}
return err;
}
示例8: iapID
void ut_cstunbinding::SetupL( )
{
iCallbackCalled = EFalse;
TUint iapID( 6 );
TInt retransmitInterval( 10 );
TBufC8<13> serveraddress( KServerAddress );
TUint serverport( 2000 );
TBufC8<4> protocol( KStun );
TBool obtainsharedsecret( EFalse );
TBool failifnoSRVrecordfound( EFalse );
iDeltatimer = CDeltaTimer::NewL( 1 );
User::LeaveIfError( iSocketServ.Connect() );
iStreamId = 1;
iSubstreamId = 1;
TBool icmpUsed( EFalse );
iMux = CNcmConnectionMultiplexer::NewL( *this );
TCommDbConnPref pref;
pref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
pref.SetIapId( iapID );
User::LeaveIfError( iConnection.Open( iSocketServ ) );
iConnection.Start( pref, iStatus );
User::WaitForRequest( iStatus );
User::LeaveIfError( iStatus.Int() );
iStunclient = CSTUNClient::NewL( retransmitInterval,
serveraddress,
serverport,
protocol,
iSocketServ,
iConnection,
*iDeltatimer,
*this,
obtainsharedsecret,
failifnoSRVrecordfound,
icmpUsed,
iMux );
if ( ut_cstunbinding::iActiveSchedulerWait.IsStarted() )
{
ut_cstunbinding::iActiveSchedulerWait.AsyncStop();
}
ut_cstunbinding::iActiveSchedulerWait.Start();
if ( !iCallbackCalled )
{
// Callback not called because of memory running out inside callback execution
User::Leave( KErrNoMemory );
}
User::LeaveIfError( iSocket.Open( iSocketServ, KAfInet, KSockDatagram,
KProtocolInetUdp ));
iBinding = CSTUNBinding::NewL( *iStunclient, iSocket );
}
示例9: ILibSocketWrapper_socket
int ILibSocketWrapper_socket(int socketType)
{
int RetVal;
// create a new connection for the socket
RConnection* pConnection = new RConnection;
// open a connection
pConnection->Open(socketServer);
TCommDbConnPref prefs;
// set the preference for the requested interface
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
pConnection->Start(prefs);
if ( (socketType == SOCK_DGRAM) ||
(socketType == SOCK_STREAM) )
{
RSocket *pSocket = new RSocket();
if ( socketType == SOCK_DGRAM )
{
pSocket->Open(socketServer,
KAfInet,
KSockDatagram,
KProtocolInetUdp,
*pConnection);
}
else
{
pSocket->Open(socketServer,
KAfInet,
KSockStream,
KProtocolInetTcp,
*pConnection);
}
RetVal = ILibSocketWrapper_GetNextAvailableHandle();
if( RetVal >= 0 )
{
SocketArray[RetVal] = (int)pSocket;
ConnectionArray[RetVal] = pConnection;
}
else
{
pSocket->Close();
delete pSocket;
pConnection->Close();
delete pConnection;
RetVal = -1;
}
}
return RetVal;
}
示例10: StartL
// -----------------------------------------------------------------------------
// CApplicationTriggeringConnDlg::StartL
// -----------------------------------------------------------------------------
//
void CApplicationTriggeringConnDlg::StartL()
{
User::LeaveIfError( iConnection.Open( iSocketServer ) );
TCommDbConnPref prefs;
prefs.SetDialogPreference( ECommDbDialogPrefPrompt );
PrintL( R_OUTPUT_PROMPT_CONNECTION_DIALOG );
iConnection.Start( prefs, iStatus );
SetActive();
}
示例11: StartInterfaceL
// -----------------------------------------------------------------------------
// CSIPExSocketEngine::StartInterfaceL
// Activates PDP ctx
// -----------------------------------------------------------------------------
//
void CSIPExSocketEngine::StartInterfaceL( const TUint32 aIapId )
{
if( !iConnection.SubSessionHandle() )
{
User::LeaveIfError( iConnection.Open( iSocketServer ) );
}
TCommDbConnPref prefs;
prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
prefs.SetDirection( ECommDbConnectionDirectionOutgoing );
prefs.SetIapId( aIapId );
User::LeaveIfError( iConnection.Start( prefs ) );
}
示例12: OpenExplicitUdpSocketL
/*
* Open an Explicit UDP Socket
*/
void CMultipleArray::OpenExplicitUdpSocketL(TInt aExtraSocksToJoin, RSocketServ iSocketServer)
{
/* Get number of sockets from script
* Open a UDP socket
* Store socket handle
* Return the EFail or EPass
*/
RSocket* sock;
RConnection* conn;
TCommDbConnPref prefs;
TInt err = 0;
sock = new (ELeave) RSocket;
conn = new (ELeave) RConnection;
CleanupStack::PushL(sock);
CleanupStack::PushL(conn);
// Start an outgoing connection
err = conn->Open(iSocketServer);
if (err!=KErrNone)
{
iQoSStep->iQoSSuite->Log(_L("Failed to open Connection: return value = <%d>"), err);
User::Leave(err);
}
// Setup SetBearerSet
prefs.SetBearerSet(iSetBearerSet[aExtraSocksToJoin]);
// Setup IAP
prefs.SetIapId(iIAP[aExtraSocksToJoin]);
err = conn->Start(prefs);
if (err!=KErrNone)
{
iQoSStep->iQoSSuite->Log(_L("Failed to open socket: return value = <%d>"), err);
User::Leave(err);
}
err = sock->Open(iSocketServer, KAfInet, KSockDatagram, KProtocolInetUdp, *conn);
if (err!=KErrNone)
{
iQoSStep->iQoSSuite->Log(_L("Failed to open socket: return value = <%d>"), err);
User::Leave(err);
}
AddSocketToListL(sock);
AddConnectionToListL(conn);
CleanupStack::Pop(2); //sock and conn
}
示例13: new
void UT_CNATFWUNSAFServerResolver::SetupL()
{
iResultArray = new (ELeave) RArray<TInetAddr>;
User::LeaveIfError(iServer.Connect(KESockDefaultMessageSlots));
User::LeaveIfError(iConnection.Open(iServer, KConnectionTypeDefault));
TCommDbConnPref prefs;
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
prefs.SetIapId(10);
User::LeaveIfError(iConnection.Start(prefs));
iObserver = UT_CNATFWUNSAFServerResolverObserverStub::NewL();
iServerResolver = CNATFWUNSAFServerResolver::NewL(iServer,
iConnection,
*iObserver,
EFalse);
}
示例14: TCommDbConnPref
void
CConnectionManager::OpenLinkLayerConnectionL()
{
#ifdef USE_RCONNECTION
User::LeaveIfError(iSocketServ->Connect());
User::LeaveIfError(iConnection->Open(*iSocketServ));
TCommDbConnPref prefs = TCommDbConnPref();
if (iIAP >= 0) {
prefs.SetIapId(iIAP);
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
iConnection->Start(prefs, iStatus);
} else if (iIAP == -2) {
// Debug mode - use system default
iConnection->Start(iStatus);
} else {
// Use Always ask
prefs.SetDialogPreference(ECommDbDialogPrefPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
# ifdef NAV2_CLIENT_SERIES60_V2
prefs.SetBearerSet( EApBearerTypeGPRS | EApBearerTypeHSCSD );
# else //s80, s90
prefs.SetBearerSet( ECommDbBearerCSD | ECommDbBearerWcdma |
ECommDbBearerCdma2000 | ECommDbBearerPSD );
# endif
iConnection->Start(prefs, iStatus);
}
SetActive();
#endif
}
示例15: DEBUG_INFO
/**
* Connect to the network using this IAP ID
*/
TInt CRconn::Start(TUint32 aIapId, TBool aPrompt)
{
DEBUG_INFO("CRconn::Start: IAP id %u\n", aIapId);
Cancel();
TCommDbConnPref prefs;
prefs.SetIapId(aIapId);
if (aPrompt)
prefs.SetDialogPreference(ECommDbDialogPrefPrompt);
else
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
iConn.Start(prefs, iStatus);
SetActive();
return 0;
}