Read-only archive of the All About Symbian forum (2001–2013) · About this archive

trying to get TCP/IP settings after connection to internet

0 replies · 1,964 views · Started 26 September 2004

Hi everyone,
I`m trying to make a small utility which makes a connection using one of the defined internet accounts in P800, and finally display the TCP/IP Settings assigned from the DHCP server on the provider side, after a succesfull connection.

Basically I want to get the LAN settings - IP address, Netmask, Gateway and DNS that the P800 uses to communicate with the server. What I did so far, was to create a connection, using a RGenericAgent, then connect to a socket server, create a TCP socket. At this stage I tried to use the socket`s function RSocket::Getopt to get the TSoIfInfo or TSoInetIfConfig information, but the problem is that the function always returns an error.

Here the snippet (without any error checking, just to be readable):


RGenericAgent agent;
agent.Open();

TRequestStatus status;
agent.StartOutgoing(status);
User::WaitForRequest(status);


if I call agent.Progress at this moment, it returns 1000. What does it mean?
Ok, after that I create a connection with a socket server.

RSocketServ socketserv;
RSocket socket;

socketserv.Connect();
socket.Open(socketserv, KAfInet, KSockStream, KProtocolInetTcp);

TSoInetIfConfig ifconfig;
typedef TPckgBuf<TSoInetIfConfig> ifconfigbuffer;
ifconfigbuf package(ifconfigbuffer);

socket.GetOpt(KSoIfConfig, KSOLInterface, package)


and this always returns an error, so I'm not able to continue getting the information packaged in the object package.

Can anyone help? Thanks.