I am developing a program for nokia6600.In my program, a dialog will pop up to ask
user to select a access point to connect to internet.My code is following:
void CApEngine::ConnectBySelect()
{
CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
CApSettingsHandler* pApSettingDlg;
pApSettingDlg = CApSettingsHandler::NewLC(ETrue, EApSettingsSelListIsListPane,
EApSettingsSelMenuSelectNormal, KEApIspTypeAll, EApBearerTypeAll, KEApSortNameAscending);
class CApEngine is derived form CActive.In CApEngine::RunL() , the return iStatus is KErrNone,
indicate that the connection is created(indeed, the G icon occur in my phone screen).Then I open
a socket to connect to server by name, but when resolving DNS, error occured.My code is as follow:
CApEngine::ConnectToServer(TDesC aServerName)
{
// Open channel to Socket Server
User::LeaveIfError(m_SocketServ.Connect());
// Initiate DNS
User::LeaveIfError(m_Resolver.Open(m_SocketServ, KAfInet, KProtocolInetUdp));
// DNS request for name resolution
m_Resolver.GetByName(aServerName, m_NameEntry, iStatus);
// Request time out
m_pTimer->After(m_nTimeOut);
SetActive();
}
But in RunL(), the return iStatus is not KErrNone,that is some error happen in resolving DNS.
Can anybody tell me why?
Thanks a lot in advance!