RConnection Start opens internet connection?
| Mon, 2008-05-26 15:51 | |
|
I want to make an automatic connection to the internet from a mobile phone, without having to select a IAP during executation of my application. I use the following code: iSocketServ.Connect();However, the call to the function bind returns -1. Only when I first make an explicit connection to the internet by means of another application, which explicitly asks me to select an IAP, the bind function works fine. |
|






Forum posts: 120
u can check the return code iConnection.Start. Use the async version of the call if possible to get better results.
Jupitar
Forum posts: 5
I actually make the call as follows:
User::LeaveIfError(iConnection.Start(prefs));Forum posts: 96
If the IAP value is invalid{note that you have used a static value 7 whcih might be invalid} then the prompt is opened automatically else it works just fine
Shashi Kiran G M
Forum posts: 96
Use the following code to Choose Access Point . You store this in a file and retreive it for Use later
RSocketServ sockserver;
sockserver.Connect();
RConnection connection;
connection.Open(sockserver);
TInt err = connection.Start();
if(err == KErrCancel)
{
//Do Nothing
}
else
{
TUint actv;
connection.EnumerateConnections(actv);
TConnectionInfoBuf infBuf;
err = connection.GetConnectionInfo(actv, infBuf);
TUint iapId = infBuf().iIapId;
}
connection.Stop();
connection.Close();
sockserver.Close();
Hope this helped
Shashi Kiran G M