HttpChannelHandlerDelegate.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:flashback 作者:
@Override
public void onRead(HttpObject httpObject) {
  if (!_connectionFlowProcessor.isComplete()) {
    _channelReadCallback.write(httpObject);
    // Accroding to http://netty.io/wiki/reference-counted-objects.html
    // When an event loop reads data into a ByteBuf and triggers a channelRead() event with it,
    // it is the responsibility of the ChannelHandler in the corresponding pipeline to release the buffer.
    // Since this is the last ChannelHandler, it release the reference-counted after read. So we need to
    // retain to make sure it will not be released until we stored in scene.
    if(httpObject instanceof HttpContent){
      ((HttpContent)httpObject).retain();
    }
    return;
  }
  _channelMediator.readFromClientChannel(httpObject);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号