What is the "recommended" way to open GPRS connection with Series60 SDK (N7650)? I have used RGenericAgent and it's StartOutgoing() member function. It opens the connection but I have encountered problems with how to be sure that connection is really up before making any network transactions. Can somebody share sample code how to make connection properly or give good places to look for more information?
BR,
Juha
RE: Series60 SDK and opening GPRS connection
1970-01-01, 02:00#2
As far as I know, the StartOutgoing method returns only when the connection "setup" is complete. It doesn't mean the connection is up. In order to make sure that you can use the connection, you have to monitor it with the ProgressNotification method (after StartOutgoing method returned) : when the progress buffer indicates that iStage == EIfProgressLinkUp, then the connection is set up.
Anyway, it gave us a headache as well, because we wanted to detemine our local IP address, which was not always possible after the StartOutgoing call completed. But, with this modification, we can always determine it.
Your answer was very helpful for us also. But we are facing another issue. Soon after gprs connection is up, i see automatic gprs disconnection and i lose the assigned local ip address. Now if i try to create connection again, i get a new local IP address, which is a problem for our application. How can i keep the connection alive forever?
Are you planning to keep your IP address so that a server can push to you? If so you might want to reconsider your design.
Firstly if the phone is NATd, as for example phones on the OrangeUK GPRS network are, this won't work.
Secondly NetOps don't like you keeping GPRS connection open all the time, they'd prefer if you only connected when needed (so much for always-on GPRS eh?)
If you need your server to be able to contact your client you can use SMS message from the server to the client to get the client to connect to the server. There's an example of how to do this in the SymbianOS C++ for Mobile Phones (Richard Harrison) book.