Search in sources :

Example 1 with Http2FrameHeaderImpl

use of com.generallycloud.baseio.codec.http2.future.Http2FrameHeaderImpl 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));
}
Also used : Http2FrameHeaderImpl(com.generallycloud.baseio.codec.http2.future.Http2FrameHeaderImpl) SocketChannelContext(com.generallycloud.baseio.component.SocketChannelContext) Http2PrefaceFuture(com.generallycloud.baseio.codec.http2.future.Http2PrefaceFuture)

Aggregations

Http2FrameHeaderImpl (com.generallycloud.baseio.codec.http2.future.Http2FrameHeaderImpl)1 Http2PrefaceFuture (com.generallycloud.baseio.codec.http2.future.Http2PrefaceFuture)1 SocketChannelContext (com.generallycloud.baseio.component.SocketChannelContext)1