×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    25

    A strange problem about choosing default access point

    Hello,everyone
    In http client example, before "iTransaction.SubmitL();"
    I use the following code to choose default access point,but when it runs in the last line
    "iSession.ConnectionInfo().SetPropertyL ( iSession.StringPool().StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );"
    the program crashes. I don't know the reason.
    The most strange thing is that the same code runs successfully one month ago.
    I will be appreciate if anyone give me suggestion. Thanks!

    -----------------------------------------------------------------
    // Initialise the socket server session.
    RSocketServ socketServ; //es_sock.h esock.lib
    User::LeaveIfError(socketServ.Connect());
    // Initialise the RConnection.
    RConnection connection;
    User::LeaveIfError(connection.Open(socketServ));
    // 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(ECommDbConnectionDirectionOutgoing);
    connectPref.SetBearerSet(ECommDbBearerGPRS);
    //connectPref.SetIapId(iapID);
    connectPref.SetIapId(4);//CMWAP 5. cmnet 4

    // start a synchronous connection
    TInt errConnect = connection.Start(connectPref);

    //Then, associate the current socket server session and rconnection object
    //used above with the HttpSession which u will be using.
    iSession.ConnectionInfo().SetPropertyL ( iSession.StringPool().StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (socketServ.Handle()) );
    TInt connPtr = REINTERPRET_CAST(TInt, &(connection));//connPtr不为零

    iSession.ConnectionInfo().SetPropertyL ( iSession.StringPool().StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );
    //把最后一行注释掉就不会crash

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393

    Re: A strange problem about choosing default access point

    Hi,

    You should at least provide the phone/emulator you are testing on as well as describe the error or problem you see for somebody to be able to help you.

    Regards,
    Nitin

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    25

    Re: A strange problem about choosing default access point

    Thanks for your reply. I test the application in Nokia3230 and Nokia7610. The application crashes. Can you tell me the possible reason.
    and can anyone tell me how to obtain the CMNET's iapid in different phone.
    Thanks!

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    25

    Re: A strange problem about choosing default access point

    I have just resolved the problem by defining "RHTTPSession iSession","RConnection connection" as a member of the class.
    Because it must remain in scope at all times when you have "iSession" open.
    Thanks!

Similar Threads

  1. Replies: 2
    Last Post: 2005-08-08, 15:50
  2. A Strange problem with NOKIA 6630/3230
    By S.S.Sudhakar in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-06-08, 11:56
  3. selecting access point by code
    By gauravj116 in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2004-11-09, 04:55
  4. Access Point Problem on Emulator
    By IlyaEck in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2004-09-06, 01:32
  5. Programatically choosing access point for RSocket
    By mike.b in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2004-05-19, 14:06

Posting Permissions

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