|
21 | 21 | import java.io.IOException; |
22 | 22 | import java.net.InetSocketAddress; |
23 | 23 |
|
| 24 | +import static org.logstash.tcp.util.DaemonThreadFactory.daemonThreadFactory; |
| 25 | + |
24 | 26 | /** |
25 | 27 | * Plain TCP Server Implementation. |
26 | 28 | */ |
@@ -66,13 +68,13 @@ public final class InputLoop implements Runnable, Closeable { |
66 | 68 | * @param decoder {@link Decoder} provided by Jruby |
67 | 69 | * @param keepAlive set to true to instruct the socket to issue TCP keep alive |
68 | 70 | */ |
69 | | - public InputLoop(final String host, final int port, final Decoder decoder, final boolean keepAlive, |
| 71 | + public InputLoop(final String id, final String host, final int port, final Decoder decoder, final boolean keepAlive, |
70 | 72 | final SslContext sslContext) { |
71 | 73 | this.sslContext = sslContext; |
72 | 74 | this.host = host; |
73 | 75 | this.port = port; |
74 | | - worker = new NioEventLoopGroup(); |
75 | | - boss = new NioEventLoopGroup(1); |
| 76 | + boss = new NioEventLoopGroup(1, daemonThreadFactory(id + "-bossGroup")); |
| 77 | + worker = new NioEventLoopGroup(daemonThreadFactory(id + "-workGroup")); |
76 | 78 | serverBootstrap = new ServerBootstrap().group(boss, worker) |
77 | 79 | .channel(NioServerSocketChannel.class) |
78 | 80 | .option(ChannelOption.SO_BACKLOG, 1024) |
@@ -152,7 +154,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E |
152 | 154 | } |
153 | 155 |
|
154 | 156 | /** |
155 | | - * Listeners that flushes the the JRuby supplied {@link Decoder} when the socket is closed. |
| 157 | + * Listeners that flushes the JRuby supplied {@link Decoder} when the socket is closed. |
156 | 158 | */ |
157 | 159 | private static final class FlushOnCloseListener implements GenericFutureListener<Future<Void>> { |
158 | 160 |
|
@@ -199,7 +201,7 @@ private static final class DecoderAdapter extends ChannelInboundHandlerAdapter { |
199 | 201 | this.decoder = decoder; |
200 | 202 | } |
201 | 203 |
|
202 | | - // 6.07 updated to pass in the full netty ChannelHandlerContext instead of the remoteaddress field |
| 204 | + // 6.07 updated to pass in the full netty ChannelHandlerContext instead of the remote address field |
203 | 205 | // corresponding interface updated |
204 | 206 | @Override |
205 | 207 | public void channelRead(final ChannelHandlerContext ctx, final Object msg) { |
|
0 commit comments