Hi whenever my program attempts to connect to a socket server, the program hangs in the server = (SocketConnection) Connector.open(url); it simply times out on a real blackberry device but in the emulator it works fine.
it use to work before but when i recently deleted the phones application data due to a exception in the midlet constructor i am unable to run any of my programs due to my programs needing to connect to some server.
i've checked my apn settings and they are correct and i have the deviceside=true statement on my url. i even tried deviceside=false but still no joy
i can freely browse any website from within the phones web browser so why cant i simply connect to a socket server?
the network provider is vodafone UK and i have set my apn settings to internet = apn access point name and web for both user/password.
can anybody please help?
here is part of my code that connects to a server. this code is on its own seperate thread btw.
Code:
public String url = "socket://24.xxx.xxx.xx:7502;deviceside=true";
public void open()
{
try
{
data.append("about to connect to the server");
server = (SocketConnection) Connector.open(url);
data.append("succesfuly connnected to the server");
is = server.openInputStream();
data.append("open input stream");
os = server.openOutputStream();
data.append("open output stream");
}
catch(Exception e)
{
e.printStackTrace();
System.out.println(e.toString());
data.append(e.toString() + "\n\n");
}
} i know it hangs in connector.open because i have posted a form screen to indicate at what stage the code is being executed on