io.netty.channel.CombinedChannelDuplexHandler Java Examples

The following examples show how to use io.netty.channel.CombinedChannelDuplexHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HttpOperations.java    From reactor-netty with Apache License 2.0 6 votes vote down vote up
static void autoAddHttpExtractor(Connection c, String name, ChannelHandler handler){

		if (handler instanceof ByteToMessageDecoder
				|| handler instanceof ByteToMessageCodec
				|| handler instanceof CombinedChannelDuplexHandler) {
			String extractorName = name+"$extractor";

			if(c.channel().pipeline().context(extractorName) != null){
				return;
			}

			c.channel().pipeline().addBefore(name, extractorName, HTTP_EXTRACTOR);

			if(c.isPersistent()){
				c.onTerminate().subscribe(null, null, () -> c.removeHandler(extractorName));
			}

		}
	}
 
Example #2
Source File: ChicagoNode.java    From xio with Apache License 2.0 4 votes vote down vote up
private CombinedChannelDuplexHandler<ChicagoResponseDecoder, ChicagoRequestEncoder>
    newMessageHandler() {
  return new CombinedChannelDuplexHandler<ChicagoResponseDecoder, ChicagoRequestEncoder>(
      new ChicagoResponseDecoder(), new ChicagoRequestEncoder());
}
 
Example #3
Source File: ChicagoNode.java    From xio with Apache License 2.0 4 votes vote down vote up
private CombinedChannelDuplexHandler<Murmur3HashedFrameDecoder, Murmur3HashedFrameEncoder>
    newMurmur3HashHandler() {
  return new CombinedChannelDuplexHandler<Murmur3HashedFrameDecoder, Murmur3HashedFrameEncoder>(
      new Murmur3HashedFrameDecoder(), new Murmur3HashedFrameEncoder());
}
 
Example #4
Source File: ChicagoNode.java    From xio with Apache License 2.0 4 votes vote down vote up
private CombinedChannelDuplexHandler<LengthFieldBasedFrameDecoder, LengthFieldPrepender>
    newLengthFieldBasedFrameHandler() {
  return new CombinedChannelDuplexHandler<LengthFieldBasedFrameDecoder, LengthFieldPrepender>(
      new LengthFieldBasedFrameDecoder(65535, 0, 2, 0, 2), new LengthFieldPrepender(2));
}