GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Replace *FutureListener* usage with Lambda where possible (#16032) (#… · netty/netty@0e1d7df

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-base/src/main/java/io/netty/handler/codec
    • MessageAggregator.java
  • codec-compression/src
    • main/java/io/netty/handler/codec/compression
      • EncoderUtil.java
      • JZlibEncoder.java
    • test/java/io/netty/handler/codec/compression
      • Lz4FrameEncoderTest.java
  • codec-http2/src
    • main/java/io/netty/handler/codec/http2
      • AbstractHttp2StreamChannel.java
      • DefaultHttp2ConnectionEncoder.java
      • Http2ConnectionHandler.java
      • Http2ControlFrameLimitEncoder.java
      • Http2FrameCodec.java
      • Http2MultiplexHandler.java
      • Http2StreamChannelBootstrap.java
    • test/java/io/netty/handler/codec/http2
      • DefaultHttp2ConnectionTest.java
      • DefaultHttp2PushPromiseFrameTest.java
      • Http2ConnectionHandlerTest.java
      • Http2ConnectionRoundtripTest.java
      • Http2FrameCodecTest.java
      • Http2MultiplexTest.java
      • Http2MultiplexTransportTest.java
  • codec-http/src
    • main
      • java/io/netty/handler/codec
        • http
          • HttpObjectAggregator.java
          • websocketx
            • WebSocketClientHandshaker.java
            • WebSocketClientProtocolHandshakeHandler.java
            • WebSocketProtocolHandler.java
            • WebSocketServerHandshaker.java
            • WebSocketServerProtocolHandshakeHandler.java
            • extensions
              • WebSocketServerExtensionHandler.java
        • spdy
          • SpdyFrameCodec.java
          • SpdySessionHandler.java
      • resources/META-INF/native-image/io.netty/netty-codec-http/generated/handlers
        • reflect-config.json
    • test/java/io/netty/handler/codec/http
      • HttpClientCodecTest.java
      • HttpServerUpgradeHandlerTest.java
      • websocketx
        • WebSocketHandshakeHandOverTest.java
  • codec-native-quic/src/test/java/io/netty/handler/codec/quic
    • QuicStreamShutdownTest.java
  • common/src
    • main/java/io/netty/util/concurrent
      • MultithreadEventExecutorGroup.java
      • PromiseNotifier.java
    • test/java/io/netty/util/concurrent
      • DefaultPromiseTest.java
      • UnorderedThreadPoolEventExecutorTest.java
  • example/src/main/java/io/netty/example
    • discard
      • DiscardClientHandler.java
    • factorial
      • FactorialClientHandler.java
    • haproxy
      • HAProxyHandler.java
    • proxy
      • HexDumpProxyBackendHandler.java
      • HexDumpProxyFrontendHandler.java
    • redis
      • RedisClient.java
    • securechat
      • SecureChatServerHandler.java
    • socksproxy
      • SocksServerConnectHandler.java
    • stomp/websocket
      • StompChatHandler.java
      • StompWebSocketChatServer.java
    • uptime
      • UptimeClient.java
  • handler-proxy/src
    • main/java/io/netty/handler/proxy
      • ProxyHandler.java
    • test/java/io/netty/handler/proxy
      • ProxyHandlerTest.java
      • ProxyServer.java
  • handler-ssl-ocsp/src/main/java/io/netty/handler/ssl/ocsp
    • OcspClient.java
    • OcspServerCertificateValidator.java
  • handler/src
    • main/java/io/netty/handler
      • address
        • DynamicAddressConnectHandler.java
        • ResolveAddressHandler.java
      • ipfilter
        • UniqueIpFilter.java
      • ssl
        • SslClientHelloHandler.java
        • SslHandler.java
      • stream
        • ChunkedWriteHandler.java
      • timeout
        • IdleStateHandler.java
    • test/java/io/netty/handler
      • flush
        • FlushConsolidationHandlerTest.java
      • ssl
        • ParameterizedSslHandlerTest.java
        • RenegotiateTest.java
        • SslHandlerTest.java
      • stream
        • ChunkedWriteHandlerTest.java
  • resolver-dns/src
    • main
      • java/io/netty/resolver/dns
        • DnsNameResolver.java
        • DnsQueryContext.java
        • DnsResolveContext.java
        • InflightNameResolver.java
      • resources/META-INF/native-image/io.netty/netty-resolver-dns/generated/handlers
        • reflect-config.json
    • test/java/io/netty/resolver/dns
      • DnsAddressResolverGroupTest.java
  • resolver/src/main/java/io/netty/resolver
    • AddressResolverGroup.java
    • CompositeNameResolver.java
    • InetSocketAddressResolver.java
    • RoundRobinInetAddressResolver.java
  • testsuite/src/main/java/io/netty/testsuite/transport/socket
    • AbstractSocketReuseFdTest.java
    • SocketBufReleaseTest.java
    • SocketHalfClosedTest.java
    • SocketSslEchoTest.java
    • SocketSslLargeCertificateTest.java
  • transport-native-epoll/src/test/java/io/netty/channel/epoll
    • EpollDomainSocketFdTest.java
  • transport-native-io_uring/src/test/java/io/netty/channel/uring
    • IoUringDomainSocketFdTest.java
  • transport-native-kqueue/src/test/java/io/netty/channel/kqueue
    • KQueueDomainSocketFdTest.java
  • transport/src
    • main
      • java/io/netty
        • bootstrap
          • AbstractBootstrap.java
          • Bootstrap.java
          • ServerBootstrap.java
        • channel
          • AbstractChannel.java
          • embedded
            • EmbeddedChannel.java
          • pool
            • AbstractChannelPoolMap.java
            • FixedChannelPool.java
            • SimpleChannelPool.java
      • resources/META-INF/native-image/io.netty/netty-transport/generated/handlers
        • reflect-config.json
    • test/java/io/netty/channel
      • AbstractCoalescingBufferQueueTest.java
      • CoalescingBufferQueueTest.java
      • DefaultChannelPipelineTest.java
      • PendingWriteQueueTest.java
      • ReentrantChannelTest.java
      • SingleThreadEventLoopTest.java
      • embedded
        • EmbeddedChannelTest.java
      • local
        • LocalChannelTest.java
      • pool
        • AbstractChannelPoolMapTest.java
        • FixedChannelPoolTest.java
      • socket/nio
        • NioSocketChannelTest.java

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-base/src/main/java/io/netty/handler/codec/MessageAggregator.java‎

Copy file name to clipboardExpand all lines: codec-base/src/main/java/io/netty/handler/codec/MessageAggregator.java
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,9 @@ protected void decode(final ChannelHandlerContext ctx, I msg, List<Object> out)
223223
// Cache the write listener for reuse.
224224
ChannelFutureListener listener = continueResponseWriteListener;
225225
if (listener == null) {
226-
continueResponseWriteListener = listener = new ChannelFutureListener() {
227-
@Override
228-
public void operationComplete(ChannelFuture future) throws Exception {
229-
if (!future.isSuccess()) {
230-
ctx.fireExceptionCaught(future.cause());
231-
}
226+
continueResponseWriteListener = listener = future -> {
227+
if (!future.isSuccess()) {
228+
ctx.fireExceptionCaught(future.cause());
232229
}
233230
};
234231
}
Collapse file

‎codec-compression/src/main/java/io/netty/handler/codec/compression/EncoderUtil.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/main/java/io/netty/handler/codec/compression/EncoderUtil.java
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package io.netty.handler.codec.compression;
1717

1818
import io.netty.channel.ChannelFuture;
19-
import io.netty.channel.ChannelFutureListener;
2019
import io.netty.channel.ChannelHandlerContext;
2120
import io.netty.channel.ChannelPromise;
2221
import io.netty.util.concurrent.Future;
@@ -37,14 +36,11 @@ public void run() {
3736
}
3837
}, THREAD_POOL_DELAY_SECONDS, TimeUnit.SECONDS);
3938

40-
finishFuture.addListener(new ChannelFutureListener() {
41-
@Override
42-
public void operationComplete(ChannelFuture f) {
43-
// Cancel the scheduled timeout.
44-
future.cancel(true);
45-
if (!promise.isDone()) {
46-
ctx.close(promise);
47-
}
39+
finishFuture.addListener(f -> {
40+
// Cancel the scheduled timeout.
41+
future.cancel(true);
42+
if (!promise.isDone()) {
43+
ctx.close(promise);
4844
}
4945
});
5046
} else {
Collapse file

‎codec-compression/src/main/java/io/netty/handler/codec/compression/JZlibEncoder.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/main/java/io/netty/handler/codec/compression/JZlibEncoder.java
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,11 @@ public void run() {
337337
}
338338
}, THREAD_POOL_DELAY_SECONDS, TimeUnit.SECONDS);
339339

340-
f.addListener(new ChannelFutureListener() {
341-
@Override
342-
public void operationComplete(ChannelFuture f) {
343-
// Cancel the scheduled timeout.
344-
future.cancel(true);
345-
if (!promise.isDone()) {
346-
ctx.close(promise);
347-
}
340+
f.addListener(f1 -> {
341+
// Cancel the scheduled timeout.
342+
future.cancel(true);
343+
if (!promise.isDone()) {
344+
ctx.close(promise);
348345
}
349346
});
350347
} else {
Collapse file

‎codec-compression/src/test/java/io/netty/handler/codec/compression/Lz4FrameEncoderTest.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/test/java/io/netty/handler/codec/compression/Lz4FrameEncoderTest.java
+7-12Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import io.netty.buffer.ByteBufInputStream;
2323
import io.netty.buffer.Unpooled;
2424
import io.netty.channel.Channel;
25-
import io.netty.channel.ChannelFuture;
26-
import io.netty.channel.ChannelFutureListener;
2725
import io.netty.channel.ChannelHandlerContext;
2826
import io.netty.channel.ChannelInitializer;
2927
import io.netty.channel.EventLoopGroup;
@@ -280,16 +278,13 @@ public void run() {
280278
final int size = 27;
281279
ByteBuf buf = ByteBufAllocator.DEFAULT.buffer(size, size);
282280
finalClientChannel.writeAndFlush(buf.writerIndex(buf.writerIndex() + size))
283-
.addListener(new ChannelFutureListener() {
284-
@Override
285-
public void operationComplete(ChannelFuture future) throws Exception {
286-
try {
287-
writeFailCauseRef.set(future.cause());
288-
} finally {
289-
latch.countDown();
290-
}
291-
}
292-
});
281+
.addListener(future -> {
282+
try {
283+
writeFailCauseRef.set(future.cause());
284+
} finally {
285+
latch.countDown();
286+
}
287+
});
293288
}
294289
});
295290
latch.await();
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectAggregator.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectAggregator.java
+8-15Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import io.netty.buffer.ByteBuf;
1919
import io.netty.buffer.Unpooled;
2020
import io.netty.channel.ChannelFuture;
21-
import io.netty.channel.ChannelFutureListener;
2221
import io.netty.channel.ChannelHandler;
2322
import io.netty.channel.ChannelHandlerContext;
2423
import io.netty.channel.ChannelPipeline;
@@ -249,23 +248,17 @@ protected void handleOversizedMessage(final ChannelHandlerContext ctx, HttpMessa
249248
if (oversized instanceof FullHttpMessage ||
250249
!HttpUtil.is100ContinueExpected(oversized) && !HttpUtil.isKeepAlive(oversized)) {
251250
ChannelFuture future = ctx.writeAndFlush(TOO_LARGE_CLOSE.retainedDuplicate());
252-
future.addListener(new ChannelFutureListener() {
253-
@Override
254-
public void operationComplete(ChannelFuture future) throws Exception {
255-
if (!future.isSuccess()) {
256-
logger.debug("Failed to send a 413 Request Entity Too Large.", future.cause());
257-
}
258-
ctx.close();
251+
future.addListener(f -> {
252+
if (!f.isSuccess()) {
253+
logger.debug("Failed to send a 413 Request Entity Too Large.", f.cause());
259254
}
255+
ctx.close();
260256
});
261257
} else {
262-
ctx.writeAndFlush(TOO_LARGE.retainedDuplicate()).addListener(new ChannelFutureListener() {
263-
@Override
264-
public void operationComplete(ChannelFuture future) throws Exception {
265-
if (!future.isSuccess()) {
266-
logger.debug("Failed to send a 413 Request Entity Too Large.", future.cause());
267-
ctx.close();
268-
}
258+
ctx.writeAndFlush(TOO_LARGE.retainedDuplicate()).addListener(future -> {
259+
if (!future.isSuccess()) {
260+
logger.debug("Failed to send a 413 Request Entity Too Large.", future.cause());
261+
ctx.close();
269262
}
270263
});
271264
}
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java
+32-46Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import io.netty.buffer.Unpooled;
1919
import io.netty.channel.Channel;
2020
import io.netty.channel.ChannelFuture;
21-
import io.netty.channel.ChannelFutureListener;
2221
import io.netty.channel.ChannelHandler;
2322
import io.netty.channel.ChannelHandlerContext;
2423
import io.netty.channel.ChannelInboundHandlerAdapter;
@@ -287,7 +286,7 @@ public ChannelFuture handshake(Channel channel) {
287286
* the {@link ChannelPromise} to be notified when the opening handshake is sent
288287
*/
289288
public final ChannelFuture handshake(Channel channel, final ChannelPromise promise) {
290-
ChannelPipeline pipeline = channel.pipeline();
289+
final ChannelPipeline pipeline = channel.pipeline();
291290
HttpResponseDecoder decoder = pipeline.get(HttpResponseDecoder.class);
292291
if (decoder == null) {
293292
HttpClientCodec codec = pipeline.get(HttpClientCodec.class);
@@ -322,26 +321,22 @@ public final ChannelFuture handshake(Channel channel, final ChannelPromise promi
322321

323322
FullHttpRequest request = newHandshakeRequest();
324323

325-
channel.writeAndFlush(request).addListener(new ChannelFutureListener() {
326-
@Override
327-
public void operationComplete(ChannelFuture future) {
328-
if (future.isSuccess()) {
329-
ChannelPipeline p = future.channel().pipeline();
330-
ChannelHandlerContext ctx = p.context(HttpRequestEncoder.class);
331-
if (ctx == null) {
332-
ctx = p.context(HttpClientCodec.class);
333-
}
334-
if (ctx == null) {
335-
promise.setFailure(new IllegalStateException("ChannelPipeline does not contain " +
336-
"an HttpRequestEncoder or HttpClientCodec"));
337-
return;
338-
}
339-
p.addAfter(ctx.name(), "ws-encoder", newWebSocketEncoder());
340-
341-
promise.setSuccess();
342-
} else {
343-
promise.setFailure(future.cause());
324+
channel.writeAndFlush(request).addListener(future -> {
325+
if (future.isSuccess()) {
326+
ChannelHandlerContext ctx = pipeline.context(HttpRequestEncoder.class);
327+
if (ctx == null) {
328+
ctx = pipeline.context(HttpClientCodec.class);
329+
}
330+
if (ctx == null) {
331+
promise.setFailure(new IllegalStateException("ChannelPipeline does not contain " +
332+
"an HttpRequestEncoder or HttpClientCodec"));
333+
return;
344334
}
335+
pipeline.addAfter(ctx.name(), "ws-encoder", newWebSocketEncoder());
336+
337+
promise.setSuccess();
338+
} else {
339+
promise.setFailure(future.cause());
345340
}
346341
});
347342
return promise;
@@ -687,32 +682,23 @@ private ChannelFuture close0(final ChannelOutboundInvoker invoker, final Channel
687682
return promise;
688683
}
689684

690-
promise.addListener(new ChannelFutureListener() {
691-
@Override
692-
public void operationComplete(ChannelFuture future) {
693-
// If flush operation failed, there is no reason to expect
694-
// a server to receive CloseFrame. Thus this should be handled
695-
// by the application separately.
696-
// Also, close might be called twice from different threads.
697-
if (future.isSuccess() && channel.isActive() &&
698-
FORCE_CLOSE_INIT_UPDATER.compareAndSet(handshaker, 0, 1)) {
699-
final Future<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() {
700-
@Override
701-
public void run() {
702-
if (channel.isActive()) {
703-
invoker.close();
704-
forceCloseComplete = true;
705-
}
685+
promise.addListener(future -> {
686+
// If flush operation failed, there is no reason to expect
687+
// a server to receive CloseFrame. Thus this should be handled
688+
// by the application separately.
689+
// Also, close might be called twice from different threads.
690+
if (future.isSuccess() && channel.isActive() &&
691+
FORCE_CLOSE_INIT_UPDATER.compareAndSet(handshaker, 0, 1)) {
692+
final Future<?> forceCloseFuture = channel.eventLoop().schedule(new Runnable() {
693+
@Override
694+
public void run() {
695+
if (channel.isActive()) {
696+
invoker.close();
697+
forceCloseComplete = true;
706698
}
707-
}, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS);
708-
709-
channel.closeFuture().addListener(new ChannelFutureListener() {
710-
@Override
711-
public void operationComplete(ChannelFuture future) throws Exception {
712-
forceCloseFuture.cancel(false);
713-
}
714-
});
715-
}
699+
}
700+
}, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS);
701+
channel.closeFuture().addListener(f -> forceCloseFuture.cancel(false));
716702
}
717703
});
718704
return promise;
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java
+9-19Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
package io.netty.handler.codec.http.websocketx;
1717

1818
import io.netty.channel.ChannelFuture;
19-
import io.netty.channel.ChannelFutureListener;
2019
import io.netty.channel.ChannelHandlerContext;
2120
import io.netty.channel.ChannelInboundHandlerAdapter;
2221
import io.netty.channel.ChannelPromise;
2322
import io.netty.handler.codec.http.FullHttpResponse;
2423
import io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler.ClientHandshakeStateEvent;
2524
import io.netty.util.concurrent.Future;
26-
import io.netty.util.concurrent.FutureListener;
2725

2826
import java.util.concurrent.TimeUnit;
2927

@@ -54,17 +52,14 @@ public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
5452

5553
@Override
5654
public void channelActive(final ChannelHandlerContext ctx) throws Exception {
57-
super.channelActive(ctx);
58-
handshaker.handshake(ctx.channel()).addListener(new ChannelFutureListener() {
59-
@Override
60-
public void operationComplete(ChannelFuture future) throws Exception {
61-
if (!future.isSuccess()) {
62-
handshakePromise.tryFailure(future.cause());
63-
ctx.fireExceptionCaught(future.cause());
64-
} else {
65-
ctx.fireUserEventTriggered(
66-
WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_ISSUED);
67-
}
55+
ctx.fireChannelActive();
56+
handshaker.handshake(ctx.channel()).addListener(future -> {
57+
if (!future.isSuccess()) {
58+
handshakePromise.tryFailure(future.cause());
59+
ctx.fireExceptionCaught(future.cause());
60+
} else {
61+
ctx.fireUserEventTriggered(
62+
ClientHandshakeStateEvent.HANDSHAKE_ISSUED);
6863
}
6964
});
7065
applyHandshakeTimeout();
@@ -125,12 +120,7 @@ public void run() {
125120
}, handshakeTimeoutMillis, TimeUnit.MILLISECONDS);
126121

127122
// Cancel the handshake timeout when handshake is finished.
128-
localHandshakePromise.addListener(new FutureListener<Void>() {
129-
@Override
130-
public void operationComplete(Future<Void> f) throws Exception {
131-
timeoutFuture.cancel(false);
132-
}
133-
});
123+
localHandshakePromise.addListener(f -> timeoutFuture.cancel(false));
134124
}
135125

136126
/**
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketProtocolHandler.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketProtocolHandler.java
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ public void close(final ChannelHandlerContext ctx, final ChannelPromise promise)
9898
}
9999
flush(ctx);
100100
applyCloseSentTimeout(ctx);
101-
closeSent.addListener(new ChannelFutureListener() {
102-
@Override
103-
public void operationComplete(ChannelFuture future) {
104-
ctx.close(promise);
105-
}
106-
});
101+
closeSent.addListener(future -> ctx.close(promise));
107102
}
108103
}
109104

@@ -138,12 +133,7 @@ public void run() {
138133
}
139134
}, forceCloseTimeoutMillis, TimeUnit.MILLISECONDS);
140135

141-
closeSent.addListener(new ChannelFutureListener() {
142-
@Override
143-
public void operationComplete(ChannelFuture future) {
144-
timeoutTask.cancel(false);
145-
}
146-
});
136+
closeSent.addListener(future -> timeoutTask.cancel(false));
147137
}
148138

149139
/**
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java
+7-10Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,13 @@ public final ChannelFuture handshake(Channel channel, FullHttpRequest req,
228228
encoderName = p.context(HttpResponseEncoder.class).name();
229229
p.addBefore(encoderName, "wsencoder", newWebSocketEncoder());
230230
}
231-
channel.writeAndFlush(response).addListener(new ChannelFutureListener() {
232-
@Override
233-
public void operationComplete(ChannelFuture future) throws Exception {
234-
if (future.isSuccess()) {
235-
ChannelPipeline p = future.channel().pipeline();
236-
p.remove(encoderName);
237-
promise.setSuccess();
238-
} else {
239-
promise.setFailure(future.cause());
240-
}
231+
channel.writeAndFlush(response).addListener(future -> {
232+
if (future.isSuccess()) {
233+
ChannelPipeline p1 = channel.pipeline();
234+
p1.remove(encoderName);
235+
promise.setSuccess();
236+
} else {
237+
promise.setFailure(future.cause());
241238
}
242239
});
243240
return promise;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.