hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugeny N Dzhurinsky <b...@redwerk.com>
Subject Re: socket errors (connection reset, read timed out)
Date Fri, 10 Nov 2006 14:55:54 GMT
On Fri, Nov 10, 2006 at 03:44:05PM +0100, Roland Weber wrote:
> Hello Eugene,
> 
> > why  "new Socket(...)" returns null? Is it something depending of 
> operation system?
> 
> new Socket(...) *never* returns null. Either it returns a new socket,
> or it throws an exception. The reflections stuff in HttpClient 3.x
> works only on JDK 1.4 and above. On JDK 1.2 or 1.3, it throws an
> exception about an unknown class or method. You know you're on a
> higher JDK level, that's why we suggested you should implement a
> socket factory that uses the 1.4 methods directly instead of going
> through reflections.

1) I don't see ANY socket exceptions at all.
2) please take a look at this statement: 

else 
    log.error("Socket is null"); 

- I can see this a lot of times.

Since I'm calling method createSocket(String host, int port, InetAddress
localAddress,int localPort)  - and it returns null, and no exceptions are
logged - looks like socket is null.

I added logging statement right below 
socket = new Socket(host, port, localAddress, localPort);

with comparison "Socket is " + (socket == null) - and I'm getting "true" in 
logs.

Any ideas?

-- 
Eugene N Dzhurinsky

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message