Fixed a problem where HttpTunnelingClientSocketChannel.setInterestOps() returns a wrong future

This commit is contained in:
Trustin Lee 2009-06-30 11:22:26 +00:00
parent f0233fc1b8
commit 6805ea719b

View File

@ -146,8 +146,20 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
@Override
public ChannelFuture setInterestOps(int interestOps) {
// TODO: Wrap the future.
return channel.setInterestOps(interestOps);
final ChannelFuture future = future(this);
channel.setInterestOps(interestOps).addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture f)
throws Exception {
if (f.isSuccess()) {
future.setSuccess();
fireChannelInterestChanged(HttpTunnelingClientSocketChannel.this);
} else {
future.setFailure(f.getCause());
fireExceptionCaught(HttpTunnelingClientSocketChannel.this, f.getCause());
}
}
});
return future;
}
@Override