当前位置: 首页>>代码示例>>C++>>正文


C++ TCommDbConnPref::SetIapId方法代码示例

本文整理汇总了C++中TCommDbConnPref::SetIapId方法的典型用法代码示例。如果您正苦于以下问题:C++ TCommDbConnPref::SetIapId方法的具体用法?C++ TCommDbConnPref::SetIapId怎么用?C++ TCommDbConnPref::SetIapId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCommDbConnPref的用法示例。


在下文中一共展示了TCommDbConnPref::SetIapId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:github188,项目名称:homebrew,代码行数:33,代码来源:ResourceManager.cpp

示例2: 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;
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:34,代码来源:panconnection.cpp

示例3: 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 );
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:30,代码来源:UT_CRtpComm.cpp

示例4: SetupL

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 );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:26,代码来源:ut_cnatfwunsafserverquery.cpp

示例5: 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
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:32,代码来源:ConnectionManager.cpp

示例6: GetState

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;
}
开发者ID:rusteer,项目名称:symbian,代码行数:31,代码来源:AppMain.cpp

示例7: 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();
    }    
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:26,代码来源:ut_mnatfwmediawrapper.cpp

示例8: 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;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:25,代码来源:ut_cnatfwunsafudpsender.cpp

示例9: SetupL

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 );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:56,代码来源:ut_cstunbinding.cpp

示例10: 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 ) );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:19,代码来源:SIPExSocketEngine.cpp

示例11: 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
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:52,代码来源:CMultipleArray.cpp

示例12: SetupL

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);

    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:17,代码来源:ut_cnatfwunsafserverresolver.cpp

示例13: Start

/**
 * 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;
}
开发者ID:ClearwaterCore,项目名称:libre-upstream,代码行数:22,代码来源:rconn.cpp

示例14: SetupL

void UT_CNATTraversalController::SetupL()
    {
    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open(iSocketServ));
    TCommDbConnPref prefs;
    prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
    prefs.SetIapId(KIapId);
    User::LeaveIfError(iConnection.Start(prefs));
    User::LeaveIfError(iSocket.Open(iSocketServ,
                                    KAfInet,
                                    KSockDatagram,
                                    KProtocolInetUdp,
                                    iConnection));

    User::LeaveIfError(iLocalAddr.Input(KLocalAddr));
    User::LeaveIfError(iNextHopAddr.Input(KNextHopAddr));

    TSIPNATTraversalControllerInitParams initParams(iSocketServ);
    iController = CNATTraversalController::NewL(&initParams);
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:21,代码来源:ut_cnattraversalcontroller.cpp

示例15: ConstructL

void CTcpProcess::ConstructL()
	{
	//Create the data buffer
	User::LeaveIfError(iSendBuf.Create(iSize));
	User::LeaveIfError(iRecvBuf.Create(iSize));
	iRecvSize = iSize;
	
	iProcessState = ECreateConnection;
	
	User::LeaveIfError(iSockServ.Connect());
	if(iMode)
		{
		//Listen at specified port
		TBuf<5>		 protocol = _L("tcp");
		User::LeaveIfError(iListenSocket.Open(iSockServ, protocol));
		User::LeaveIfError(iListenSocket.SetOpt(KSoReuseAddr, KProtocolInetIp, 1));
		User::LeaveIfError(iListenSocket.SetLocalPort(iPort));
		User::LeaveIfError(iListenSocket.Listen(5));
		User::LeaveIfError(iSocket.Open(iSockServ));
		iListenSocket.Accept(iSocket, iStatus);
		iConsole.Printf(_L("\nWait for a connection at port[%d].\n"), iPort);
		}
	else
		{
        RConnection conn;  
        User::LeaveIfError(conn.Open(iSockServ));
        TCommDbConnPref pref;
        pref.SetIapId(13);
        pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
        User::LeaveIfError(conn.Start(pref));
        
		//Connect to specified server
		User::LeaveIfError(iSocket.Open(iSockServ, KAfInet, KSockStream, KProtocolInetTcp, conn));
		iSocket.Connect(iAddr, iStatus);

		iConsole.Printf(_L("\nConnecting....\n"));
		}
	SetActive();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:39,代码来源:tcptest.cpp


注:本文中的TCommDbConnPref::SetIapId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。