hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpCore NIO hurt by JDK bug?
Date Mon, 01 Nov 2010 20:37:02 GMT
On Mon, 2010-11-01 at 13:25 -0700, swatkatz wrote:
> We are using HttpCore 4.0.1
> 
> Also in particular in DefaultConnectingIOReactor -
> 
>  SocketChannel socketChannel;
>             try {
>                 socketChannel = SocketChannel.open();
>                 socketChannel.configureBlocking(false);
>             } catch (IOException ex) {
>                 throw new IOReactorException("Failure opening socket", ex);
>             }
>             try {
>                 validateAddress(request.getLocalAddress());
>                 validateAddress(request.getRemoteAddress());
>                 
>                 if (request.getLocalAddress() != null) {
>                     socketChannel.socket().bind(request.getLocalAddress());
>                 }
>                 boolean connected =
> socketChannel.connect(request.getRemoteAddress());
>                 if (connected) {
>                     prepareSocket(socketChannel.socket());
>                     ChannelEntry entry = new ChannelEntry(socketChannel,
> request); 
>                     addChannel(entry);
>                     return;
>                 }
>             } catch (IOException ex) {
>                 request.failed(ex);
>                 return;
>             }
> 
> 
> In the above code - should the socketChannel be closed before request.failed
> is called ?
> 

You are right. It should be but it is not. Please raise an issue in JIRA
for this defect.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message