hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suladna <sula...@yahoo.com>
Subject java.net.SocketException: Software caused connection abort: recv failed
Date Wed, 24 Sep 2008 09:28:38 GMT
Hi!
 
I use HttpClient to connect to different websites which are all under the same domain. After
having connected to a site and brought its html-code to my java-program, I wait 5 seconds
until I connect to the next site (using Thread.sleep).
 
I start by making one HttpHost and defining a HttpEntity and HttpRespons
 
final HttpHost target = new HttpHost("www.xxxxxxx.se", 80, "http");
HttpEntity entity = null;
HttpResponse rsp = null;
 
After that I use a loop to connect to each subsite, having the adresses urlEnding. I write
the following in the loop:
 
HttpRequest req = createRequest(urlEnding);
rsp = client.execute(target, req);
String[] line = EntityUtils.toString(rsp.getEntity()).split("\n");  //this info is used by
program 
if (entity != null){ 
  entity.consumeContent(); 
}
 
And now to my problem:
 
After having connected to a number of websites (the number varies) I often get a java.net.SocketException.
Please see the attached bmp-file for the whole stack. In the case of the attached file, I
manage to connect to 243 websites before the exception is thrown.
 
Interestingly, the java-function that should send me an e-mail after the HttpClient is finished
with its work then also throws an exception (IpClientException). I suppose these problems
are connected in some way.
 
Best regards,
Sul Adna


      
Mime
View raw message