Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Using PersonalJava java.net.Socket class on P800

1 replies · 2,167 views · Started 26 March 2003

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="derek_ocallaghan"]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]

This is an Internet connection setup issue and not related specifically to Java. You are likely using a setting that routes all traffic over a WAP gateway and only the Internet application (browser) supports WAP gateway communication, that's why you see it working there. You need to obtain a connection that allow direct Internet access to the host you want to reach. Please check with your mobile operator to see if they support a connection setting that does not require using a WAP gateway. P800 supports defining multiple account settings that can be used by different clients so you could still define for example a WAP account to be used by the browser to reach certain hosts that are only available that way, while you could define a direct Internet access account as the default one if supported by the network. Unless there's a way for you to set up a direct account then you won't be able to exploit the full potential of this product,
so it's an important issue to solve.