@Override public void initChannel(NioDatagramChannel ch) throws Exception { ch.pipeline().addLast(stats.udp); ch.pipeline().addLast(new PacketDecoder()); MessageHandler messageHandler = new MessageHandler(ch, nodeManager); nodeManager.setMessageSender(messageHandler); ch.pipeline().addLast(messageHandler); } });
@Override protected void initChannel(NioDatagramChannel ch) throws Exception { ChannelPipeline channelPipLine = ch.pipeline(); int maxLength = Integer.MAX_VALUE; ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(maxLength, 2, 4, 0, 0)); ch.pipeline().addLast(new NetProtoBufMessageUDPEncoder()); ch.pipeline().addLast(new NetProtoBufMessageUDPDecoder()); channelPipLine.addLast("logger", new LoggingHandler(LogLevel.DEBUG)); channelPipLine.addLast(new GameNetMessageUdpServerHandler()); } }
@Override protected void initChannel(NioDatagramChannel ch) throws Exception { ChannelPipeline cp = ch.pipeline(); cp.addLast(new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { DatagramPacket dp = (DatagramPacket) msg; KcpClient.this.onReceive(dp); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { KcpClient.this.handleException(cause, null); KcpClient.this.close(); } }); } });
@Override protected void initChannel(NioDatagramChannel ctx) throws Exception { ctx.pipeline() // .addLast(new LoggingHandler(LogLevel.INFO)) .addLast(new SSLocalUdpProxyHandler(server, port, method, password, obfs, obfsparam)) ; } })
@Override protected void initChannel(NioDatagramChannel ch) throws Exception { ChannelPipeline cp = ch.pipeline(); cp.addLast(new KcpServer.UdpHandler()); } });
@Override protected void initChannel(NioDatagramChannel ch) throws Exception { ch.pipeline().addLast(new SourceLogListenHandler(logEventCallback)); } });
@Override protected void initChannel(NioDatagramChannel ch) throws Exception { LOG.trace("initChannel: clientHandler connects to EchoServer."); ChannelPipeline p = ch.pipeline(); p.addLast(new LoggingHandler("UscAgentUdpHandler 2", LogLevel.TRACE)); p.addLast(new ClientHandler()); p.addLast(new LoggingHandler("UscAgentUdpHandler 2", LogLevel.TRACE)); } });
@Override public void initChannel(final NioDatagramChannel ch) throws Exception { if (secureService == null) { log.error("UscSecureService is not initialized!"); return; } ChannelPipeline p = ch.pipeline(); // no remoteAddress yet until data received, so need a // handler // to add the channel p.addLast("callHomeHandler", callHomeHandler); p.addLast(new LoggingHandler(LogLevel.TRACE)); ChannelHandler dtlsHandler = secureService .getUdpServerHandler(ch); initAgentPipeline(ch.pipeline(), dtlsHandler); } });
@Override protected void initChannel(NioDatagramChannel channel) throws Exception { final ChannelPipeline pipeline = channel.pipeline(); pipeline .addLast(new SimpleChannelInboundHandler<DatagramPacket>(false) { @Override protected void channelRead0(final ChannelHandlerContext ctx, final DatagramPacket msg) throws Exception { threadPool.submit(new Runnable() { @Override public void run() { ctx.fireChannelRead(msg); } }); } }) .addLast(protocolDecoder) .addLast(defragmenter) .addLast(flch); finalizePipeline(pipeline); } })
@Override public void initChannel(NioDatagramChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); agentServerChannel = ch; p.addLast(new ChannelInboundHandlerAdapter() {
@Override public void initChannel(NioDatagramChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); agentServerChannel = ch; p.addLast(new ChannelInboundHandlerAdapter() {
@Override protected void initChannel(NioDatagramChannel ctx) throws Exception { ctx.attr(SSCommon.IS_UDP).set(true); ICrypt _crypt = CryptFactory.get(method, password); assert _crypt != null; _crypt.isForUdp(true); ctx.attr(SSCommon.CIPHER).set(_crypt); ctx.pipeline() // .addLast(new LoggingHandler(LogLevel.INFO)) // in .addLast("ssCheckerReceive", new SSServerCheckerReceive()) // out .addLast("ssCheckerSend", new SSServerCheckerSend()) //ss-cypt .addLast("ssCipherCodec", new SSCipherCodec()) //ss-protocol .addLast("ssProtocolCodec", new SSProtocolCodec()) //proxy .addLast("ssUdpProxy", new SSServerUdpProxyHandler()) ; } })