Maybe this is a more general question about R* classes but here goes.
When I start my application upon user input I establish a connection to an access point. e.g.
Later in another part of the program I need to do a hostname lookup (among other things). This is done in another class where I do not have access to the RConnection in MyClass. (keeping in mind I have not disconnected the earlier connection to the AP)Code:class MyClass { private: /* other members */ RSocketServ iSocketServer; RConnection iConnection; }; MyClass:StartMyAppL() { User::LeaveIfError(iSocketServer.Connect()); User::LeaveIfError(iConnection.Open(iSocketServer)); /* other stuff */ }
When LookupL() is executed the third statement leaves because iResolver.Open returns -18 KErrNotReady. Is this like "Device already in use"?Code:class OtherClass { private: RSocketServ iSocketServer; RConnection iConnection; RHostResolver iResolver; }; void OtherClass::LookupL() { User::LeaveIfError(iSocketServer.Connect()); User::LeaveIfError(iConnection.Open(iSocketServer)); User::LeaveIfErorr(iResolver.Open(iSocketServer, KAfInet, KProtocolInetTcp, iConnection)); }
Do I have to make available my original RConnection to the LookupL() function and use it instead of opening another? If I choose not to provide the iConnection to the iResolver.Open() call the code works fine but I am prompted for access point selection again (which I don't want). So what am I doing wrong? What is the correct way to use RConnection?
Thanks



