Sorry that I could not go through your script completely. There a couple of points:
1. TCP/IP connection uses GPRS (answer to your question)
2. You need to verify if the machine running Java program to accept socket connection is accessible from the modem. Fire walls on both (client and server) sides should allow such connections.
3. If the above is there, then you need to check if your service provider is blocking traffic on any particular ports. You can try out with different ports.
Let me know if none of the above works.