Vodafone UK "internet" apn

  • Thread starter Stelrad Doulton
  • Start date
S

Stelrad Doulton

Hi,

I am having real trouble using the Vodaphone "internet" APN. I am doing a
very simple HttpWebRequest to retrieve a 7 k text file. I am careful to
close the response stream so that subsequent requests will be serviced....
only they are not. Only the first request is successful, after this I just
get 404 or timeout errors. The same code on a the T-Mobile
general.t-mobile.uk APN does not suffer with this issue!!

Hanging up and redialling does not help, only restarting the app will solve
the problem. I don't understand this behaviour!! Has anyone seen anything
similar? Or has a suggestion?


public void DownloadFileText(string filename, string url)

{

if(!ras.Connected)

{

MessageBox.Show("No RAS connection");

return;

}


StartTimer();

HttpWebRequest request = null;

HttpWebResponse response = null;

try

{

request = (HttpWebRequest)WebRequest.Create(url);

request.Method = "GET";

response = (HttpWebResponse) request.GetResponse();

MessageBox.Show(response.StatusCode.ToString());

Stream respStream = response.GetResponseStream();

StreamReader reader = new StreamReader(respStream);

StreamWriter writer = new StreamWriter(filename, false);

string data = reader.ReadLine();

while (data != null)

{

writer.WriteLine(data);

data = reader.ReadLine();

}

reader.Close();

writer.Close();

}

catch (Exception e)

{

MessageBox.Show(e.Message);

}

finally

{

if(response != null)

{

MessageBox.Show(response.StatusCode.ToString());

response.Close();

}

request = null;

response = null;

}

FinishTimer();

}



Thank you all.
 
S

Stelrad Doulton

Hi,

Still no joy although it looks like I am coming into the webserver with a
different IP address each time. What implications does this have on how I
should set up the WebRequest?
 
S

Stelrad Doulton

I now see that the same instanc of ServicePoint is being used, I think that
this is a problem because the IP has changed (how I do not know). Does
anyone know how to force a new ServicePoint on each request?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top