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

HttpConnection GPRS failure

1 replies · 2,711 views · Started 23 November 2004

Hi all,

I've got a problem concerning the connection towards the internet when done through gprs.
my phone is a P900, my provider is Proximus (Belgium).

My problem is that I always get symbian error code -33 if I request for an html page by IP address. If I request the html page by using the name of the site (in this case "www.philips.com"😉, I get an error code -5131 (dns host not found)

No matter what I change, I keep getting the same error messages.

The strange thing is, when the phone is connected with the pc (by using the usb cable), then I can access the html page.
I assume that the phone isn't using the gprs connection at that time, but is routing its http requests through the pc.

Also, the browser, delivered with the phone works, both via the pc as via the gprs connection.

Does anyone know what might be the problem?

basically, this is the code I execute for making a connection:

HttpConnection conn = null;
DataInputStream istr = null;
String url = "http://161.88.242.11";

try
{
conn = (HttpConnection) Connector.open(url);
conn.setRequestMethod(HttpConnection.GET);



int resp = conn.getResponseCode();


istr = new DataInputStream(conn.openInputStream());
int length = (int) conn.getLength();
if (length != -1)
{
int inputChar;

ByteArrayOutputStream bstr = new ByteArrayOutputStream();

int ch;

for(int i = 0;i<length;i++)
{
if((ch = istr.read())!= -1)
{
bstr.write(ch);
}
}
str = new String(bstr.toByteArray());
bstr.close();

}
else // length is not available
{
ByteArrayOutputStream bstr = new ByteArrayOutputStream();

int ch;

while((ch = istr.read()) != -1)
bstr.write(ch);

str = new String(bstr.toByteArray());
bstr.close();
}

istr.close();

:frown:

problem solved.

if you have the same problem, contact your provider and ask for the settings for your direct internet connection via gprs.