×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    21

    How to retreive the IP address after GPRS connection

    Hi
    I am using RGenericAgent class in Symbian to start GPRS connection.
    How we can retrieve IP address and related info. after successfully establishing a gprs connection so that it can be used for further communication?

    Thanx in advance
    Saurabh

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    I'm not 100 percent sure, but I believe that you have to create a socket to get the right value of your IP address...
    you can try something like this:
    Code:
    RSocketServ sockServer;
    RHostResolver Resolver;
    TNameEntry Result;
    TRequestStatus status;
    TInetAddr iAddr;
    
    sockServer.Connect();
    Resolver.Open(sockServer,KAfInet, KProtocolInetUdp);
    Resolver.GetByName(_L("something"),Result,status);
    User::WaitForRequest(status);
    
    Resolver.GetByName(_L(""),Result, status);
    User::WaitForRequest(status);
    	
    iAddr.SetAddress(TInetAddr::Cast(Result().iAddr).Address());
    Resolver.Close();	
    sockServer.Close();

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    21

    Thanx

    Hi
    Thanx sopta.........
    It worked fine.

    Saurabh

Posting Permissions

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