×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    3

    RConnection WLAN selecting crash on N8

    Hello,

    I'm using in my app http api from httpexampleclient SDK example.
    Connect is made by WLAN, but sometimes connection with iConnection.Start(iStatus);
    returns -1 error code, so i want to reselect or select diffrent acces point. My code looks like:

    Code:
    void CClient::ConstructL()
    	{
    	
    	// Open connection.
    	User::LeaveIfError(iSocketServ.Connect());
    	TInt result = iConnection.Open(iSocketServ);
    	
    	// Open the RHTTPSession
    	iSess.OpenL();
    	
    	// setup preferences 
    	iStatus.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    
    	// Initiate connection
    	TInt connResult = iConnection.Start(iStatus);
    	if(connResult!=KErrNone) {
    		// If connection failed, launch IAP selection dialog.
    		TInt stopResult = iConnection.Stop();
    		iStatus.SetDialogPreference(ECommDbDialogPrefPrompt);
    		connResult = iConnection.Start(iStatus);
    	}
    
    	// Install this class as the callback for authentication requests
    	InstallAuthenticationL(iSess);
    	
    	User::LeaveIfError(iFileServ.Connect());
    	iTransObs = CEventHandler::NewL();
    	
    	}
    After -1 in connResult
    Code:
    TInt stopResult = iConnection.Stop();
    returns -18(KErrNotReady) , but IAP dialog is shown.
    Then I select WLAN access point - > app crash immediately.

    What I'm doing wrong?

    (Any clue will be appreciated).

    Cheers
    ~bartosh

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: RConnection WLAN selecting crash on N8

    Whenever you see TRequestStatus, you are starting an asynchronous request, and the given method will return immediately. Learn about active objects (since there seem to be an 'iStatus' in your code). Or, in this particular case you could use the synchronous variant of RConnection::Start, just invoke it without any arguments (it simply returns its result code).

    EDIT: Ok, that was not an answer to your question, I just noticed the iStatus.SetDialogPreference... A side note: consider using meaningful names for variables.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    3

    Re: RConnection WLAN selecting crash on N8

    Hi,

    yes, variable name is confusing, too many changes were made in this code.
    So its clearer version and shorter question:

    Code:
    // Initiate connection
    User::LeaveIfError(iSocketServ.Connect());
    TInt result = iConnection.Open(iSocketServ);
    		
    // Open the RHTTPSession
    iSess.OpenL();
    		
    // setup preferences 
    // WORKS : 
    iPrefs.SetDialogPreference(ECommDbDialogPrefWarn);
    // CRASH (after selecting acces point) 
    // iPrefs.SetDialogPreference(ECommDbDialogPrefPrompt);
    
    TInt connResult = iConnection.Start(iPrefs);
    
    // Install this class as the callback for authentication requests
    InstallAuthenticationL(iSess);
    	
    User::LeaveIfError(iFileServ.Connect());
    
    iTransObs = CEventHandler::NewL();
    ECommDbDialogPrefPrompt makes WLAN acces point selecting dialog apeear and crash.

    EDIT: asynchronous version also fails, but in different way: applications stops responding, and shows infinitely two last frames blinking (like there is some wrong with double buffering).
    Last edited by bartoszp; 2010-11-22 at 11:48.

Similar Threads

  1. RConnection::Start() and RConnection::Stop() causes ViewSrv 11
    By er.khalid in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2011-04-12, 09:52
  2. Nokia N8: Browsing and Selecting mobile memory folder
    By sangramp@cybage.com in forum [Archived] Flash Lite on Nokia Devices
    Replies: 0
    Last Post: 2010-11-16, 09:40
  3. How can I create a WLAN access point without using standart AP-selecting dialog 2009
    By olkazmin in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2009-03-25, 07:05
  4. WLAN RConnection::Start()
    By nly in forum VoIP
    Replies: 0
    Last Post: 2007-02-27, 23:06
  5. app crash on selecting "Cancel" option on a menu
    By rashmi_ghai in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-12-07, 02:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×