Hi,
I'm running a Java app on a P800 which tries to open a socket connection to a server, the code I'm using is:
Socket testSocket = new Socket(<server ip>, <port number>😉;
It appears to use the preferred internet connection when this app is run, but I get a NoRouteToHostException every time. However, I can connect to the server using the browser, which uses the same preferred internet connection (indirectly through the preferred WAP account). I have tried setting the proxy server in the internet connection setting to be the same as the Address field in the WAP account setting, but it doesn't work.
Any ideas on how I can solve this?
thanks,
Derek
[quote="Anonymous"]Hi,
I'm running a Java app on a P800 which tries to open a socket connection to a server, the code I'm using is:
Socket testSocket = new Socket(<server ip>, <port number>😉;
It appears to use the preferred internet connection when this app is run, but I get a NoRouteToHostException every time. However, I can connect to the server using the browser, which uses the same preferred internet connection (indirectly through the preferred WAP account). I have tried setting the proxy server in the internet connection setting to be the same as the Address field in the WAP account setting, but it doesn't work.
Any ideas on how I can solve this?
thanks,
Derek[/quote]
In case you have a WAP account enabled so that your GPRS setting specify an APN in its setting (the Address: field in the Advanced Settings specifying a host name) then that is a proxy server that sits in between the GPRS equipment and the network in your operator's mobile network. That proxy controls what network resources you are able to access. Part of a WAP account setting typically that Address: field specifies a proxy server that directs the traffic towards
a WAP Gateway. You also typically have a Wap Gateway setting enabled.
The P800 Browser (Internet application) supports WAP and thus work in this environment. But if your Java application tries to make a connection towards the Internet then likely your mobile operator is preventing direct Internet access if you use the WAP oriented APN in the Address: field.
Often the operator offers alternative settings. If you try defining a GPRS account that leaves the Address: field blank then possibly that helps.
or the operator may be able to offer a proxy host address that allow direct Internet access. Consult the operator or thewir web site to see if they offer such a setting.
I think that's the problem in your case.