Please, show me why don't resolve domain name to IP address on S60 3rd !!!

Login to reply to this topic.
Sun, 2008-06-01 16:52
Joined: 2008-05-15
Forum posts: 2

Puzzled
Run ok on S60 2nd and phone Emulator S60 3rd but not run on Phone Release GCCE S60 3rd. Help me please!!! I think server not found, but i don't know what to do.
Phone connected GPRS, can connect web.

// Sockets objects
/** The socket server */
RSocketServ aSocketServ;
/** For resolving DNS addresses */
RHostResolver aHostResolver;
/** Server address */
TInetAddr aInetAddr;

// Open channel to Socket Server
User::LeaveIfError(aSocketServ.Connect());

// Connect to a host resolver (for DNS resolution) - happens sychronously
User::LeaveIfError( aHostResolver.Open( aSocketServ, KAfInet, KProtocolInetUdp ));
// Try to resolve symbolic name
TNameEntry nameEntry;
User::LeaveIfError (aHostResolver.GetByName( aDomain, nameEntry ));
TSockAddr sockAddr = nameEntry().iAddr;
aInetAddr = aInetAddr.Cast( sockAddr );

TInetAddr :: Cast(aInetAddr).Output(ipAddr);

aSocketServ.Close();


Sun, 2008-06-01 17:12
Joined: 2006-05-08
Forum posts: 162
Re: Please, show me why don't resolve domain name to IP address

Hi bblazy,

First of all, there's a big difference between 2nd edition and 3rd edition SDKs IIRC, which is the 3rd edition SDKs actually use Symbian OS 9x. This means you need to take care of platform security issues.

Since you are using IP DNS lookup, you'll need to assign your executable NetworkServices capability to use DNS lookup.
Apart form that, another issue you might have is you may have is using 'implicit' host resolver. You may want to use an RConnection instance while opening the RHostResolver (you can simply start the connection using the default preferences by calling RConnection::Srat with no params).

Also, an efficiency warning. You can always write:
TInetAddr sockAddr = nameEntry().iAddr;
You don't need to go through the casting business.


Mon, 2008-06-02 03:11
Joined: 2008-05-15
Forum posts: 2
Re: Please, show me why don't resolve domain name to IP address

Thank maxxxpayne so much. I see. And I think my problem is how to assign my executable Network Services capability to use DNS lookup. I don't know how to do that. Show me please!!!
( When I run on 2nd, I have to choose Network Services automatic. On 3rd, what should i do??? )

Tue, 2008-10-21 04:17
Joined: 2008-10-21
Forum posts: 2
Re: Please, show me why don't resolve domain name to IP address

Hi bblazy,have you solved this problem ??
I get an ip address for "www.sina.net" with "2.0.2...1.0.8", could some guy give me an answer ? I have NetworkService capability by the way.
Thank you all.

  • Login to reply to this topic.