当前位置: 首页>>代码示例>>Java>>正文


Java Http2ConnectionEncoder类代码示例

本文整理汇总了Java中io.netty.handler.codec.http2.Http2ConnectionEncoder的典型用法代码示例。如果您正苦于以下问题:Java Http2ConnectionEncoder类的具体用法?Java Http2ConnectionEncoder怎么用?Java Http2ConnectionEncoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Http2ConnectionEncoder类属于io.netty.handler.codec.http2包,在下文中一共展示了Http2ConnectionEncoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newHttp2ConnectionHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
private Http2ClientConnectionHandler newHttp2ConnectionHandler(Channel ch) {
    final boolean validateHeaders = false;
    final Http2Connection conn = new DefaultHttp2Connection(false);
    conn.addListener(new Http2GoAwayListener(ch));

    Http2FrameReader reader = new DefaultHttp2FrameReader(validateHeaders);
    Http2FrameWriter writer = new DefaultHttp2FrameWriter();

    Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(conn, writer);
    Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(conn, encoder, reader);

    final Http2Settings http2Settings = http2Settings();

    final Http2ResponseDecoder listener = new Http2ResponseDecoder(conn, ch, encoder);
    final Http2ClientConnectionHandler handler =
            new Http2ClientConnectionHandler(decoder, encoder, http2Settings, listener);
    // Setup post build options
    handler.gracefulShutdownTimeoutMillis(clientFactory.idleTimeoutMillis());

    return handler;
}
 
开发者ID:line,项目名称:armeria,代码行数:22,代码来源:HttpClientPipelineConfigurator.java

示例2: newHttp2ConnectionHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
private Http2ConnectionHandler newHttp2ConnectionHandler(ChannelPipeline pipeline) {

        final Http2Connection conn = new DefaultHttp2Connection(true);
        conn.addListener(new Http2GoAwayListener(pipeline.channel()));

        Http2FrameReader reader = new DefaultHttp2FrameReader(true);
        Http2FrameWriter writer = new DefaultHttp2FrameWriter();

        Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(conn, writer);
        Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(conn, encoder, reader);

        final Http2ConnectionHandler handler =
                new Http2ServerConnectionHandler(decoder, encoder, new Http2Settings());

        // Setup post build options
        final Http2RequestDecoder listener =
                new Http2RequestDecoder(config, pipeline.channel(), handler.encoder());

        handler.connection().addListener(listener);
        handler.decoder().frameListener(listener);
        handler.gracefulShutdownTimeoutMillis(config.idleTimeoutMillis());

        return handler;
    }
 
开发者ID:line,项目名称:armeria,代码行数:25,代码来源:HttpServerPipelineConfigurator.java

示例3: build

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
@Override
protected Http2TestHandler build(Http2ConnectionDecoder decoder,
        Http2ConnectionEncoder encoder, Http2Settings initialSettings) {
    Http2TestHandler handler = new Http2TestHandler(decoder, encoder, initialSettings);
    frameListener(handler);
    return handler;
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:8,代码来源:Http2TestHandler.java

示例4: build

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
@Override
protected HelloWorldHttp2Handler build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
                                       Http2Settings initialSettings) {

    HelloWorldHttp2Handler handler = new HelloWorldHttp2Handler(decoder, encoder, initialSettings);
    frameListener(handler);
    return handler;
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:9,代码来源:HelloWorldHttp2HandlerBuilder.java

示例5: Http2ClientConnectionHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
Http2ClientConnectionHandler(
        Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
        Http2Settings initialSettings, Http2ResponseDecoder responseDecoder) {

    super(decoder, encoder, initialSettings);
    this.responseDecoder = responseDecoder;
    connection().addListener(responseDecoder);
    decoder().frameListener(responseDecoder);
}
 
开发者ID:line,项目名称:armeria,代码行数:10,代码来源:Http2ClientConnectionHandler.java

示例6: build

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
@Override
protected HTTP2SourceHandler build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
                                   Http2Settings initialSettings) {
    HTTP2SourceHandler handler = new HTTP2SourceHandler(decoder, encoder, initialSettings, connectionManager,
            listenerConfiguration);
    frameListener(handler);
    connection(new DefaultHttp2Connection(true));
    return handler;
}
 
开发者ID:wso2,项目名称:carbon-transports,代码行数:10,代码来源:HTTP2SourceHandlerBuilder.java

示例7: HTTP2SourceHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
HTTP2SourceHandler(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
                   Http2Settings initialSettings, ConnectionManager connectionManager, ListenerConfiguration
                           listenerConfiguration) {
    super(decoder, encoder, initialSettings);
    this.listenerConfiguration = listenerConfiguration;
    this.connectionManager = connectionManager;
}
 
开发者ID:wso2,项目名称:carbon-transports,代码行数:8,代码来源:HTTP2SourceHandler.java

示例8: build

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
@Override
protected Http2Handler build(
    Http2ConnectionDecoder decoder,
    Http2ConnectionEncoder encoder,
    Http2Settings initialSettings) {
  return new Http2Handler(decoder, encoder, initialSettings);
}
 
开发者ID:xjdr,项目名称:xio,代码行数:8,代码来源:Http2HandlerBuilder.java

示例9: GrpcHttp2ConnectionHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
public GrpcHttp2ConnectionHandler(
    ChannelPromise channelUnused,
    Http2ConnectionDecoder decoder,
    Http2ConnectionEncoder encoder,
    Http2Settings initialSettings) {
  super(decoder, encoder, initialSettings);
  this.channelUnused = channelUnused;
}
 
开发者ID:grpc,项目名称:grpc-java,代码行数:9,代码来源:GrpcHttp2ConnectionHandler.java

示例10: AbstractNettyHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
AbstractNettyHandler(
    ChannelPromise channelUnused,
    Http2ConnectionDecoder decoder,
    Http2ConnectionEncoder encoder,
    Http2Settings initialSettings) {
  super(channelUnused, decoder, encoder, initialSettings);

  // During a graceful shutdown, wait until all streams are closed.
  gracefulShutdownTimeoutMillis(GRACEFUL_SHUTDOWN_NO_TIMEOUT);

  // Extract the connection window from the settings if it was set.
  this.initialConnectionWindow = initialSettings.initialWindowSize() == null ? -1 :
          initialSettings.initialWindowSize();
}
 
开发者ID:grpc,项目名称:grpc-java,代码行数:15,代码来源:AbstractNettyHandler.java

示例11: build

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
@Override
public ApnsClientHandler build(final Http2ConnectionDecoder decoder, final Http2ConnectionEncoder encoder, final Http2Settings initialSettings) {
    Objects.requireNonNull(this.authority(), "Authority must be set before building a TokenAuthenticationApnsClientHandler.");
    Objects.requireNonNull(this.signingKey(), "Signing key must be set before building a TokenAuthenticationApnsClientHandler.");

    final ApnsClientHandler handler = new TokenAuthenticationApnsClientHandler(decoder, encoder, initialSettings, this.authority(), this.signingKey(), this.idlePingIntervalMillis());
    this.frameListener(handler);
    return handler;
}
 
开发者ID:relayrides,项目名称:pushy,代码行数:10,代码来源:TokenAuthenticationApnsClientHandler.java

示例12: Http2TestHandler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
private Http2TestHandler(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
        Http2Settings initialSettings) {
    super(decoder, encoder, initialSettings);
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:5,代码来源:Http2TestHandler.java

示例13: HelloWorldHttp2Handler

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
HelloWorldHttp2Handler(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder,
                       Http2Settings initialSettings) {
    super(decoder, encoder, initialSettings);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:5,代码来源:HelloWorldHttp2Handler.java

示例14: Http2ResponseDecoder

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
Http2ResponseDecoder(Http2Connection conn, Channel channel, Http2ConnectionEncoder encoder) {
    super(channel);
    this.conn = conn;
    this.encoder = encoder;
}
 
开发者ID:line,项目名称:armeria,代码行数:6,代码来源:Http2ResponseDecoder.java

示例15: Http2RequestDecoder

import io.netty.handler.codec.http2.Http2ConnectionEncoder; //导入依赖的package包/类
Http2RequestDecoder(ServerConfig cfg, Channel channel, Http2ConnectionEncoder writer) {
    this.cfg = cfg;
    this.writer = writer;
    inboundTrafficController = new InboundTrafficController(channel);
}
 
开发者ID:line,项目名称:armeria,代码行数:6,代码来源:Http2RequestDecoder.java


注:本文中的io.netty.handler.codec.http2.Http2ConnectionEncoder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。