use of com.generallycloud.baseio.codec.http2.future.Http2PrefaceFuture in project baseio by generallycloud.
the class Http2ProtocolDecoder method decode.
@Override
public ChannelFuture decode(SocketChannel channel, ByteBuf buffer) throws IOException {
Http2SocketSession http2UnsafeSession = (Http2SocketSession) channel.getSession();
SocketChannelContext context = channel.getContext();
if (http2UnsafeSession.isPrefaceRead()) {
return new Http2PrefaceFuture(context, allocate(channel, PROTOCOL_PREFACE_HEADER));
}
return new Http2FrameHeaderImpl(channel, allocate(channel, PROTOCOL_HEADER));
}
Aggregations