×

Discussion Board

Results 1 to 11 of 11

Thread: IAP problem

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    IAP problem

    Hi all,

    When we are trying to run a program, where one active session (Internet, it can be GPRS/EDGE) is required. But it is prompting IAP lists everytime I am connecting or changing the views. Here the IP address is changing everytime (I am using EDGE). I want to have the same IP address and it shouldn't prompt the user to select IAP everytime. It can prompt for first time. How can I do it in Symbian S60 3rd Ed FP1.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: IAP problem

    Search for RConnection (in the SDK Help, Wiki, DiBo, etc.)

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    30

    Re: IAP problem

    You can't have the same IP all the time, unless you are connected to a network that staically allocates IP address for your device... highly unlikely, specially when you have mentioned you are using EDGE.

    What you can do is, retrieve a list of the IAPs available (see CApUtils et. al.), (display it) and select the IAP (you should know which one it is by looking at the name, since you seem to know...) that you'd like to use. Once you've got the IAP, get the IAP ID and use it to initiate a network connection using RConnection::Start(TCommDbConnPref&...) variant. Make sure that you correctly set the iap id and dialog mode correctly for TCommDbConnPref.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: IAP problem

    I can't get static IP, as our operators are not providing this one at this moment. Everything is dynamic IP address. This IP address can be changed, but only if we restart our application. When the applications is opened, in all the views same IP address should be taken up. How can it be? Is there any specific OS level implementation for it?

  5. #5
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: IAP problem

    The IP address isn't up to the phone. It is provided by the provider.
    You need to use some other way to identify your session. Depending what it is you could use for example a user name, the phone's IMEI, SIM's IMSI or just a random session number.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: IAP problem

    Nigel, Maxxxpayne: if you kindly read the question you will probably see that Mobileteam is asking about if it is possible to connect to an Internet Access Point (even with user interaction) at the startup of the application, then use that IAP without further question on every RSocket::Connect (probably). And that is exactly what RConnection does.

    Mobileteam: you should introduce an RSocketServ and RConnection object in some common place in your application, RConnection::Start will explicitly bring you the IAP selection dialog (however it is also possible to launch an IAP without user interaction, search for RConnection in the Wiki if you are interested), then every time you RSocket::Open, you should supply the same RSocketServ reference, and the Start-ed RConnection object (so you have to use the "RSocket::Open(RSocketServ &aServer, TUint addrFamily, TUint sockType, TUint protocol, RConnection &aConnection);") overload).

  7. #7
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: IAP problem

    Quote Originally Posted by wizard_hu_ View Post
    ...if you kindly read the question you will probably see that Mobileteam is asking about if it is possible to connect to an Internet Access Point (even with user interaction) at the startup of the application, then use that IAP without further question on every RSocket::Connect (probably).
    wizard_hu, yes, I understand that. But the emphasis of the question seems to be keeping the same IP address. I was assuming he was using the address for some kind of session tracking (Mobileteam, is this the case?) Using an RConnection won't necessarily fix this because the connection can go down for reasons outside the handset's control, then Mobileteam will be back where he started.

    If Mobileteam doesn't require the same IP address then RConnection is just the thing.

  8. #8
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: IAP problem

    wizard_hu: yes, you are right. We created a new class where we created this Connection object, but we failed to access this same connection object from other .cpp files. The reason for it is if we access this connection object using that class object, the data will be lost as it creates new instance. And we are not able to create a static instance for this connection object. Please help me.

    Nigel: What ever you assumed is also partially correct. As our intension is we want to use same ip address through out our application, where it makes multiple http requests in multiple views. In that place I'm getting new IP address as the view was changed and I'm creating new instance.

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: IAP problem

    A rude but possible approach is adding these object to the AppUi:
    Code:
    AppUi.h
    public:
        RSocketServ iSocketServ;
        RConnestion iConnection;
    
    AppUi::ConstructL
    {
        ...
        User::LeaveIfError(iSocketServ.Connect());
        User::LeaveIfError(iConnection.Open(iSocketServ));
        User::LeaveIfError(iConnection.Start());
        ...
    }
    
    AppUi::~AppUi
    {
        ...
        iConnection.Close();
        iSocketServ.Close();
    }
    Then you can access these members anywhere:
    Code:
    // somewhere in the middle of something
    
    iSocket.Open(
        static_cast<CMyAppUi*>(CCoeEnv::Static()->AppUi())->iSocketServ,
        KAfInet, KSockStream, KProtocolInetTcp,
        static_cast<CMyAppUi*>(CCoeEnv::Static()->AppUi())->iConnection);
    Of course it is possible to provide getter methods, put the whole thing in a separate singleton object, or even via simply using global variables.

  10. #10
    Registered User
    Join Date
    Jun 2007
    Posts
    50

    Re: IAP problem

    Thank you wizard_hu... But shall I ask some simple doubt? What is iSocket here. What can be the data type of this one. Can it be the object of RSocket or RSocketServ?

  11. #11
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: IAP problem

    Quote Originally Posted by mobileteam View Post
    Thank you wizard_hu... But shall I ask some simple doubt? What is iSocket here. What can be the data type of this one. Can it be the object of RSocket or RSocketServ?
    It is RSocket. [RSocket::Open(RSocketServ....)]

Similar Threads

  1. Please solve iap_ id problem
    By sriramadasu in forum Symbian
    Replies: 0
    Last Post: 2006-09-26, 14:40
  2. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  3. Problem in configuring the IAP table in Symbian CommDb editor
    By natarajuab in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-12-07, 15:47
  4. Problem with socket IAP
    By smallfish_ntu in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-05-24, 04:15
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

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