I don't know if anyone is interested in it, but I have the answer for my original question : we can release the GPRS PDP context by closing everything that is socket-related. I closed the sockets, host resolver and the socket server and since I was the only user of the connection, the connection got closed. That's all! I'm not sure if we have to do _all_ these things, but I think it's the best way.
Some answers to nitin's requests :
- I don't why your PC doesn't get the data sent by your phone. Are you behind a firewall? That may hinder incoming packets (from phone to PC). When you send a UDP datagram is it sent successfully? Do you have a snipper program for your PC? Sometimes the datagrams arrive to your PC, but perhaps because your program was configured improperly it doesn't get the packets at all.
- Local IP as 0 : we had been struggling with this program for a long time, but we found the solution. Though we establish a GPRS connection manually (i.e. by code), I guess it's the same with dialog selection ==> we use RGenericAgent in order to establish a connection, but when it returns the connection has NOT been established yet! It was only the setup phase and we need to wait for a while in order to get a working connection. You can use the very same RGenericAgent object for progress notification : when it notices that the connection is up (connection state == EIfProgressLinkUp), then you can use the connection, then you can get your local IP address that won't be 0. So, the order : 1. RGenericAgent::StartOutgoing, 2. RGenericAgent::ProgressNotification.
- Anyway, you can easily check whether there's a GPRS connection established ==> there's a 'G' letter near the top-left corner of the display. When this 'G' has a square around it, then the connection is up. When only the 'G' is visible, you've attached to the GPRS network. When this 'G' is crossed with a line : your GPRS connection is suspended.
Hope I could help you,