You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/22 02:01:57 UTC
[james-project] 26/29: JAMES-3715 Close opened channels
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit b2d9f9e142d6c8be12ad656d94facffe5917c77f
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Mar 21 10:33:12 2022 +0700
JAMES-3715 Close opened channels
See https://github.com/apache/james-project/pull/898 for graceful shutdown
---
.../apache/james/protocols/netty/AbstractAsyncServer.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index eefeff6..1e6bdb2 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -136,19 +136,20 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
workerGroup.shutdownGracefully();
}
+ if (channels != null) {
+ channels.close();
+ }
+
started = false;
}
@Override
public synchronized List<InetSocketAddress> getListenAddresses() {
- ImmutableList.Builder<InetSocketAddress> builder = ImmutableList.builder();
- for (Channel channel : ImmutableList.copyOf(channels.iterator())) {
- builder.add((InetSocketAddress) channel.localAddress());
- }
- return builder.build();
+ return channels.stream()
+ .map(channel -> (InetSocketAddress) channel.localAddress())
+ .collect(ImmutableList.toImmutableList());
}
-
/**
* Create ChannelPipelineFactory to use by this Server implementation
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org