List of usage examples for io.netty.handler.codec.http HttpClientCodec HttpClientCodec
public HttpClientCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean failOnMissingResponse)
From source file:com.basho.riak.client.core.netty.HttpChannelInitializer.java
License:Apache License
@Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline();//from w w w . ja v a2s . c om p.addLast("codec", new HttpClientCodec(4096, 8192, 8192, true)); p.addLast("riakHttpOperationEncoder", new RiakHttpOperationEncoder()); }
From source file:com.ning.http.client.providers.netty_4.NettyAsyncHttpProvider.java
License:Apache License
protected HttpClientCodec newHttpClientCodec() { if (asyncHttpProviderConfig != null) { return new HttpClientCodec(asyncHttpProviderConfig.getMaxInitialLineLength(), asyncHttpProviderConfig.getMaxHeaderSize(), asyncHttpProviderConfig.getMaxChunkSize(), false); } else {/*from ww w.ja v a 2s. co m*/ return new HttpClientCodec(); } }
From source file:etcd.client.HttpClient.java
License:Open Source License
public HttpClient(EventLoopGroup eventLoopGroup, Executor executor, ServerList servers, boolean autoReconnect) { this.eventLoopGroup = eventLoopGroup; this.executor = executor; this.servers = servers; this.autoReconnect = autoReconnect; bootstrap = new Bootstrap().group(eventLoopGroup).channel(NioSocketChannel.class) .option(ChannelOption.SO_REUSEADDR, true).handler(new ChannelInitializer<SocketChannel>() { @Override/* w ww . j ava2s. com*/ protected void initChannel(SocketChannel channel) throws Exception { final ChannelPipeline pipeline = channel.pipeline(); pipeline.addLast(new HttpClientCodec(4096, 8192, 8192, true), new HttpObjectAggregator(1024 * 1024), new HttpClientHandler()); } }).validate(); }
From source file:org.asynchttpclient.providers.netty.channel.ChannelManager.java
License:Open Source License
private HttpClientCodec newHttpClientCodec() { return new HttpClientCodec(// nettyConfig.getHttpClientCodecMaxInitialLineLength(), // nettyConfig.getHttpClientCodecMaxHeaderSize(), // nettyConfig.getHttpClientCodecMaxChunkSize(), // false);/* www .j a v a 2 s.c o m*/ }
From source file:org.asynchttpclient.providers.netty.channel.Channels.java
License:Apache License
protected HttpClientCodec newHttpClientCodec() { if (nettyProviderConfig != null) { return new HttpClientCodec(// nettyProviderConfig.getMaxInitialLineLength(), // nettyProviderConfig.getMaxHeaderSize(), // nettyProviderConfig.getMaxChunkSize(), // false);/*from w w w .j av a 2s . com*/ } else { return new HttpClientCodec(); } }