java类io.netty.channel.ChannelPipeline的实例源码

RPCChannelInitializer.java 文件源码 项目:fresco_floodlight 阅读 35 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(Channel ch) throws Exception {
    RPCChannelHandler channelHandler = 
            new RPCChannelHandler(syncManager, rpcService);

    IdleStateHandler idleHandler = 
            new IdleStateHandler(5, 10, 0);
    ReadTimeoutHandler readTimeoutHandler = 
            new ReadTimeoutHandler(30);

    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast("idle", idleHandler);
    pipeline.addLast("timeout", readTimeoutHandler);
    pipeline.addLast("handshaketimeout",
                     new HandshakeTimeoutHandler(channelHandler, timer, 10));

    pipeline.addLast("syncMessageDecoder",
                     new SyncMessageDecoder(maxFrameSize));
    pipeline.addLast("syncMessageEncoder",
                     new SyncMessageEncoder());

    pipeline.addLast("handler", channelHandler);
}
OFChannelHandler.java 文件源码 项目:fresco_floodlight 阅读 72 收藏 0 点赞 0 评论 0
/**
 * Creates a handler for interacting with the switch channel
 *
 * @param controller
 *            the controller
 * @param newConnectionListener
 *            the class that listens for new OF connections (switchManager)
 * @param pipeline
 *            the channel pipeline
 * @param threadPool
 *            the thread pool
 * @param idleTimer
 *            the hash wheeled timer used to send idle messages (echo).
 *            passed to constructor to modify in case of aux connection.
 * @param debugCounters
 */
OFChannelHandler(@Nonnull IOFSwitchManager switchManager,
        @Nonnull INewOFConnectionListener newConnectionListener,
        @Nonnull ChannelPipeline pipeline,
        @Nonnull IDebugCounterService debugCounters,
        @Nonnull Timer timer,
        @Nonnull List<U32> ofBitmaps,
        @Nonnull OFFactory defaultFactory) {

    Preconditions.checkNotNull(switchManager, "switchManager");
    Preconditions.checkNotNull(newConnectionListener, "connectionOpenedListener");
    Preconditions.checkNotNull(pipeline, "pipeline");
    Preconditions.checkNotNull(timer, "timer");
    Preconditions.checkNotNull(debugCounters, "debugCounters");

    this.pipeline = pipeline;
    this.debugCounters = debugCounters;
    this.newConnectionListener = newConnectionListener;
    this.counters = switchManager.getCounters();
    this.state = new InitState();
    this.timer = timer;
    this.ofBitmaps = ofBitmaps;
    this.factory = defaultFactory;

    log.debug("constructor on OFChannelHandler {}", String.format("%08x", System.identityHashCode(this)));
}
WorldLoginListener.java 文件源码 项目:Quavo 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void handleMessage(ChannelHandlerContext ctx, WorldLoginRequest msg) {
    ClientMessage message = evaluateLogin(msg);
    if (message != ClientMessage.SUCCESSFUL) {
        ctx.write(new WorldLoginResponse(message));
        return;
    }

    Player player = new Player(ctx.channel());
    ctx.write(new WorldLoginResponse(player, message, msg.getIsaacPair()));

    ChannelPipeline pipeline = ctx.pipeline();
    pipeline.remove("login.encoder");

    // this isnt set automatically.
    pipeline.addAfter("world.decoder", "game.encoder", new GamePacketEncoder(msg.getIsaacPair().getEncoderRandom()));
    pipeline.replace("world.decoder", "game.decoder", new GamePacketDecoder(player, msg.getIsaacPair().getDecoderRandom()));

    player.init(msg.getDisplayInformation());
}
Client.java 文件源码 项目:push 阅读 33 收藏 0 点赞 0 评论 0
public void run() {
    workerGroup = new NioEventLoopGroup();
    try {
        Bootstrap b = new Bootstrap();
        b.group(workerGroup);
        b.channel(NioSocketChannel.class);
        // b.option(ChannelOption.SO_KEEPALIVE, true);
        b.handler(new ChannelInitializer<SocketChannel>() {
            @Override
            public void initChannel(SocketChannel ch) throws Exception {
                ChannelPipeline pipeline = ch.pipeline();
                pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(65536, 0, 4, 0, 4));
                pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
                pipeline.addLast("decoder", new MsgPackDecode());
                pipeline.addLast("encoder", new MsgPackEncode());
                pipeline.addLast(new ClientHandler());
            }
        });
        channel = b.connect(clientProperties.getServerHost(), clientProperties.getServerPort()).sync().channel();
        status = Status.START;
        channel.closeFuture().sync();
    } catch (Exception e) {
        e.printStackTrace();
    }
    status = Status.STOP;
}
MockingFCMServerInitializer.java 文件源码 项目:push-network-proxies 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();

    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }

    p.addLast(new HttpRequestDecoder());
    // Uncomment the following line if you don't want to handle HttpChunks.
    //p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpResponseEncoder());
    // Remove the following line if you don't want automatic content compression.
    //p.addLast(new HttpContentCompressor());
    p.addLast(new MockingFCMServerHandler());
}
GraphiakInitializer.java 文件源码 项目:graphiak 阅读 32 收藏 0 点赞 0 评论 0
@Override
public void initChannel(final SocketChannel ch) throws Exception {
    final ChannelPipeline p = ch.pipeline();

    // removes idle connections after READER_IDLE_SECONDS seconds
    p.addLast("idleStateHandler",
            new IdleStateHandler(READER_IDLE_SECONDS, 0, 0));

    // handle new connections and idle timeouts
    p.addLast("auth", authHandler);

    // break each data chunk by newlines and split out metrics
    p.addLast("line", new GraphiteMetricDecoder(maxLength));

    // batch up metrics and store
    p.addLast("metrics", new MetricHandler(store));
}
TinyProtocol.java 文件源码 项目:ZentrelaRPG 阅读 133 收藏 0 点赞 0 评论 0
private void unregisterChannelHandler() {
    if (serverChannelHandler == null)
        return;

    for (Channel serverChannel : serverChannels) {
        final ChannelPipeline pipeline = serverChannel.pipeline();

        // Remove channel handler
        serverChannel.eventLoop().execute(new Runnable() {

            @Override
            public void run() {
                try {
                    pipeline.remove(serverChannelHandler);
                } catch (NoSuchElementException e) {
                    // That's fine
                }
            }

        });
    }
}
TinyProtocol.java 文件源码 项目:SamaGamesAPI 阅读 29 收藏 0 点赞 0 评论 0
private void unregisterChannelHandler() {
    if (serverChannelHandler == null)
        return;

    for (Channel serverChannel : serverChannels) {
        final ChannelPipeline pipeline = serverChannel.pipeline();

        // Remove channel handler
        serverChannel.eventLoop().execute(new Runnable() {

            @Override
            public void run() {
                try {
                    pipeline.remove(serverChannelHandler);
                } catch (NoSuchElementException e) {
                    // That's fine
                }
            }

        });
    }
}
ConnectionEncoder.java 文件源码 项目:Quavo 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void encode(ChannelHandlerContext ctx, ConnectionResponse msg, ByteBuf out) throws Exception {
    ChannelPipeline pipeline = ctx.pipeline();

    switch (msg.getType()) {
    case HANDSHAKE_CONNECTION:
        pipeline.addAfter("decoder", "handshake.encoder", new HandshakeEncoder());
        pipeline.replace("decoder", "handshake.decoder", new HandshakeDecoder());
        break;
    case LOGIN_CONNECTION:
        out.writeByte(ClientMessage.SUCCESSFUL_CONNECTION.getId());
        pipeline.addAfter("decoder", "login.encoder", new LoginEncoder());
        pipeline.replace("decoder", "login.decoder", new LoginDecoder());
        break;
    }

    pipeline.remove(this);
}
MqttTransportServerInitializer.java 文件源码 项目:iotplatform 阅读 41 收藏 0 点赞 0 评论 0
@Override
  public void initChannel(SocketChannel ch) {
    ChannelPipeline pipeline = ch.pipeline();
    SslHandler sslHandler = null;
    if (sslHandlerProvider != null) {
      sslHandler = sslHandlerProvider.getSslHandler();
      pipeline.addLast(sslHandler);
    }
    pipeline.addLast("decoder", new MqttDecoder(MAX_PAYLOAD_SIZE));
    pipeline.addLast("encoder", MqttEncoder.INSTANCE);

    MqttTransportHandler handler = new MqttTransportHandler(msgProducer, deviceService, authService, assetService,
        assetAuthService, relationService, sslHandler);
    pipeline.addLast(handler);

//    ch.closeFuture().addListener(handler);

  }
HttpChannelInitializer.java 文件源码 项目:tasfe-framework 阅读 32 收藏 0 点赞 0 评论 0
public final ChannelPipeline appendHttpPipeline(ChannelPipeline channelPipeline) {
    // 服务端,对响应编码。属于ChannelOutboundHandler,逆序执行
    channelPipeline.addLast("encoder", new HttpResponseEncoder());

    // 服务端,对请求解码。属于ChannelIntboundHandler,按照顺序执行
    channelPipeline.addLast("decoder", new HttpRequestDecoder());
    //即通过它可以把 HttpMessage 和 HttpContent 聚合成一个 FullHttpRequest,并定义可以接受的数据大小,在文件上传时,可以支持params+multipart
    channelPipeline.addLast("aggregator", new HttpObjectAggregator(maxConentLength));
    //块写入写出Handler
    channelPipeline.addLast("chunkedWriter", new ChunkedWriteHandler());

    // 对传输数据进行压缩,这里在客户端需要解压缩处理
    // channelPipeline.addLast("deflater", new HttpContentCompressor());

    HttpServletHandler servletHandler = new HttpServletHandler();
    servletHandler.addInterceptor(new ChannelInterceptor());
    //servletHandler.addInterceptor(new HttpSessionInterceptor(getHttpSessionStore()));
    // 自定义Handler
    channelPipeline.addLast("handler", servletHandler);
    // 异步
    // channelPipeline.addLast(businessExecutor, new AsyncHttpServletHandler());
    return channelPipeline;
}
ConfigHandler.java 文件源码 项目:ClusterDeviceControlPlatform 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
    super.channelActive(ctx);
    logger.info("通道重置");
    List<ChannelPipeline> channelPipelines = tcpMediator.getSendingMsgRepo().getChannelPipelines();
    channelPipelines.add(ctx.pipeline());
    channelPipelines.removeIf(channel -> {
        i++;
        if (channel == null || !channel.channel().isActive()) {
            logger.info("「" + i + "」" + "通道失效");
            return true;
        } else {
            logger.info("「" + i + "」" + "通道有效");
            return false;
        }
    });
    i = 0;
    logger.info("通道数量:" + channelPipelines.size());
}
HttpServerInitHandler.java 文件源码 项目:util4j 阅读 26 收藏 0 点赞 0 评论 0
@Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline p = ch.pipeline();
        if(sslCtx!=null)
        {
            p.addLast(new SslHandler(sslCtx.newEngine(ch.alloc())));
        }
        p.addLast(new HttpResponseEncoder());//必须放在最前面,如果decoder途中需要回复消息,则decoder前面需要encoder
        p.addLast(new HttpRequestDecoder());
        p.addLast(new HttpObjectAggregator(65536));//限制contentLength
        //大文件传输处理
//      p.addLast(new ChunkedWriteHandler());
//      p.addLast(new HttpContentCompressor());
        //跨域配置
        CorsConfig corsConfig = CorsConfigBuilder.forAnyOrigin().allowNullOrigin().allowCredentials().build();
        p.addLast(new CorsHandler(corsConfig));
        p.addLast(new DefaultListenerHandler<HttpRequest>(listener));
    }
ClientChannelInitializer.java 文件源码 项目:jsf-sdk 阅读 39 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();
    // 根据服务端协议,选择解码器
    Constants.ProtocolType type = transportConfig.getProvider().getProtocolType();
    switch (type) {
        case jsf:
            pipeline.addLast(new JSFEncoder());
            pipeline.addLast(new JSFDecoder(transportConfig.getPayload()));
            break;
        case dubbo:
            pipeline.addLast(new DubboEncoder());
            pipeline.addLast(new DubboDecoder(transportConfig.getPayload()));
            break;
        default:
            throw new InitErrorException("Unsupported client protocol type : " + type.name());
    }
    pipeline.addLast(Constants.CLIENT_CHANNELHANDLE_NAME, clientChannelHandler);
}
SocketConnection.java 文件源码 项目:reactive-pg-client 阅读 26 收藏 0 点赞 0 评论 0
void initiateProtocolOrSsl(String username, String password, String database, Handler<? super CommandResponse<Connection>> completionHandler) {
  ChannelPipeline pipeline = socket.channelHandlerContext().pipeline();
  if (ssl) {
    Future<Void> upgradeFuture = Future.future();
    upgradeFuture.setHandler(ar -> {
      if (ar.succeeded()) {
        initiateProtocol(username, password, database, completionHandler);
      } else {
        Throwable cause = ar.cause();
        if (cause instanceof DecoderException) {
          DecoderException err = (DecoderException) cause;
          cause = err.getCause();
        }
        completionHandler.handle(CommandResponse.failure(cause));
      }
    });
    pipeline.addBefore("handler", "initiate-ssl-handler", new InitiateSslHandler(this, upgradeFuture));
  } else {
    initiateProtocol(username, password, database, completionHandler);
  }
}
NettyServerHandlerInitializer.java 文件源码 项目:happylifeplat-transaction 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    final ChannelPipeline pipeline = ch.pipeline();
    NettyPipelineInit.serializePipeline(serializeProtocolEnum, pipeline);
    pipeline.addLast("timeout",
            new IdleStateHandler(nettyConfig.getHeartTime(), nettyConfig.getHeartTime(), nettyConfig.getHeartTime(), TimeUnit.SECONDS));
    pipeline.addLast(nettyServerMessageHandler);
}
NettyClientHandlerInitializer.java 文件源码 项目:happylifeplat-transaction 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
    final ChannelPipeline pipeline = socketChannel.pipeline();
    NettyPipelineInit.serializePipeline(serializeProtocolEnum, pipeline);
    pipeline.addLast("timeout", new IdleStateHandler(txConfig.getHeartTime(), txConfig.getHeartTime(), txConfig.getHeartTime(), TimeUnit.SECONDS));
    pipeline.addLast(nettyClientMessageHandler);

}
PlayerInitializer.java 文件源码 项目:cr-private-server 阅读 46 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel channel) throws Exception {
    ClientCrypto clientCrypto = new ClientCrypto(NetworkServer.SERVER_KEY);
    ServerCrypto serverCrypto = new ServerCrypto();

    clientCrypto.setServer(serverCrypto);
    serverCrypto.setClient(clientCrypto);

    ChannelPipeline pipeline = channel.pipeline();
    pipeline.addLast(new PacketDecoder(serverCrypto));
    pipeline.addLast(new PacketEncoder(serverCrypto));
    pipeline.addLast(new PlayerHandler(server));
}
NettyHttpClient.java 文件源码 项目:GitHub 阅读 25 收藏 0 点赞 0 评论 0
@Override public void prepare(final Benchmark benchmark) {
  this.concurrencyLevel = benchmark.concurrencyLevel;
  this.targetBacklog = benchmark.targetBacklog;

  ChannelInitializer<SocketChannel> channelInitializer = new ChannelInitializer<SocketChannel>() {
    @Override public void initChannel(SocketChannel channel) throws Exception {
      ChannelPipeline pipeline = channel.pipeline();

      if (benchmark.tls) {
        SslClient sslClient = SslClient.localhost();
        SSLEngine engine = sslClient.sslContext.createSSLEngine();
        engine.setUseClientMode(true);
        pipeline.addLast("ssl", new SslHandler(engine));
      }

      pipeline.addLast("codec", new HttpClientCodec());
      pipeline.addLast("inflater", new HttpContentDecompressor());
      pipeline.addLast("handler", new HttpChannel(channel));
    }
  };

  bootstrap = new Bootstrap();
  bootstrap.group(new NioEventLoopGroup(concurrencyLevel))
      .option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
      .channel(NioSocketChannel.class)
      .handler(channelInitializer);
}
NettyChatServerInitializer.java 文件源码 项目:sctalk 阅读 24 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();

    pipeline.addLast("framer", new LengthFieldBasedFrameDecoder(400 * 1024, 0, 4, -4, 0));
    pipeline.addLast("decoder", new PacketDecoder());
    pipeline.addLast("encoder", new PacketEncoder());
    pipeline.addLast(new LoggingHandler(LogLevel.DEBUG));
    pipeline.addLast("handler", new MessageServerHandler(handlerManager));
}
NetworkMessageHandler.java 文件源码 项目:Quavo 阅读 29 收藏 0 点赞 0 评论 0
@Override
protected void channelRead0(ChannelHandlerContext ctx, NetworkMessage msg) throws Exception {
    NetworkMessageListener<NetworkMessage> listener = NetworkMessageRepository.getNetworkListener(msg);

    listener.handleMessage(ctx, msg);

    ChannelPipeline pipeline = ctx.pipeline();
    ChannelHandler handler = msg.getHandler();

    if (pipeline.context(handler) != null) {

        // flush for specific handler.
        pipeline.context(handler).flush();
    }
}
HttpClientInitializer.java 文件源码 项目:Ashbringer-load 阅读 30 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {

    ChannelPipeline p = ch.pipeline();

    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    p.addLast(new HttpClientCodec());
}
ClientInitializer.java 文件源码 项目:TakinRPC 阅读 27 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(T ch) throws Exception {
    ChannelPipeline p = ch.pipeline();

    p.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));
    p.addLast("protobufDecoder", new ProtobufDecoder(NettyRpcProto.RpcContainer.getDefaultInstance()));

    p.addLast("frameEncoder", new LengthFieldPrepender(4));
    p.addLast("protobufEncoder", new ProtobufEncoder());

    ConcurrentHashMap<Integer, RpcCall> callMap = new ConcurrentHashMap<Integer, RpcCall>();
    p.addLast(eventExecutor, "inboundHandler", new InboundHandler(callMap));
    p.addLast("outboundHandler", new OutboundHandler(callMap));

}
ServerInitializer.java 文件源码 项目:TakinRPC 阅读 36 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();

    p.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));
    p.addLast("protobufDecoder", new ProtobufDecoder(NettyRpcProto.RpcContainer.getDefaultInstance()));

    p.addLast("frameEncoder", new LengthFieldPrepender(4));
    p.addLast("protobufEncoder", new ProtobufEncoder());

    p.addLast(eventExecutor, "serverHandler", handler);
}
WebSocketServerInitializer.java 文件源码 项目:os 阅读 56 收藏 0 点赞 0 评论 0
protected void initChannel(NioSocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();
    // 编解码 http 请求
    pipeline.addLast(new HttpServerCodec());
    // 写文件内容
    pipeline.addLast(new ChunkedWriteHandler());
    // 聚合解码 HttpRequest/HttpContent/LastHttpContent 到 FullHttpRequest
    // 保证接收的 Http 请求的完整性
    pipeline.addLast(new HttpObjectAggregator(64 * 1024));
    // 处理其他的 WebSocketFrame
    pipeline.addLast(new WebSocketServerProtocolHandler("/chat"));
    // 处理 TextWebSocketFrame
    pipeline.addLast(protoCodec);
    pipeline.addLast(serverHandler);
}
NettyWebServerInitializer.java 文件源码 项目:sctalk 阅读 25 收藏 0 点赞 0 评论 0
@Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        logger.info("******", pipeline.toString());
        pipeline.addLast("http-codec", new HttpServerCodec());
        pipeline.addLast("aggregator", new HttpObjectAggregator(65536)); // Http消息组装  
        pipeline.addLast("http-chunked", new ChunkedWriteHandler()); // WebSocket通信支持  
        pipeline.addLast("framer", new LengthFieldBasedFrameDecoder(400 * 1024, 0, 4, -4, 0));
//        pipeline.addLast("decoder", new PacketDecoder());
//        pipeline.addLast("encoder", new PacketEncoder());
        pipeline.addLast(new LoggingHandler(LogLevel.DEBUG));
        pipeline.addLast("handler", new MessageSocketServerHandler(handlerManager));
    }
HttpHelloWorldServerInitializer.java 文件源码 项目:cornerstone 阅读 29 收藏 0 点赞 0 评论 0
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline p = ch.pipeline();
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpRequestDecoder());
    p.addLast(new HttpObjectAggregator(20248));
    p.addLast(new VINettyHandler());
    p.addLast(new HttpHelloWorldServerHandler());
}
FMLNetworkHandler.java 文件源码 项目:CustomWorldGen 阅读 34 收藏 0 点赞 0 评论 0
@SideOnly(Side.CLIENT)
private static void addClientHandlers()
{
    ChannelPipeline pipeline = channelPair.get(Side.CLIENT).pipeline();
    String targetName = channelPair.get(Side.CLIENT).findChannelHandlerNameForType(FMLRuntimeCodec.class);
    pipeline.addAfter(targetName, "GuiHandler", new OpenGuiHandler());
    pipeline.addAfter(targetName, "EntitySpawnHandler", new EntitySpawnHandler());
}
ProtocolUnificationHandler.java 文件源码 项目:neto 阅读 29 收藏 0 点赞 0 评论 0
private void switchToHttp(ChannelHandlerContext ctx) {
    ChannelPipeline p = ctx.pipeline();
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(65536));
    p.addLast(new WebSocketServerCompressionHandler());
    p.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, "ws", true));
    p.addLast(new NetoJsonStringToMapWebSocketDecoder());
    p.addLast(new NetoMessageToWebsocketFrameEncoder());
    p.remove(this);

    // 핸들러를 다시 등록 했으므로 이벤트를 전파
    ctx.fireChannelActive();
}
ServerChannelInitializer.java 文件源码 项目:tcp-gateway 阅读 32 收藏 0 点赞 0 评论 0
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
    ProtobufAdapter adapter = new ProtobufAdapter(config);

    ChannelPipeline pipeline = socketChannel.pipeline();
    pipeline.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
    pipeline.addLast("decoder", adapter.getDecoder());
    pipeline.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
    pipeline.addLast("encoder", adapter.getEncoder());
    pipeline.addLast("handler", new TcpServerHandler(config));
}


问题


面经


文章

微信
公众号

扫码关注公众号