public final class Http3FrameToHttpObjectCodec extends Http3RequestStreamInboundHandler implements io.netty.channel.ChannelOutboundHandler
Http3RequestStreamFrame to HttpObject,
and back. It can be used as an adapter in conjunction with Http3ServerConnectionHandler or Http3ClientConnectionHandler to make http/3 connections
backward-compatible with ChannelHandlers expecting HttpObject.
For simplicity, it converts to chunked encoding unless the entire stream is a single header.
| Constructor and Description |
|---|
Http3FrameToHttpObjectCodec(boolean isServer) |
Http3FrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(io.netty.channel.ChannelHandlerContext ctx,
SocketAddress localAddress,
io.netty.channel.ChannelPromise promise) |
protected void |
channelInputClosed(io.netty.channel.ChannelHandlerContext ctx)
Called once the input is closed and so no more inbound data is received on it.
|
protected void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Http3DataFrame frame)
Called once a
Http3DataFrame is ready for this stream to process. |
protected void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Http3HeadersFrame frame)
Called once a
Http3HeadersFrame is ready for this stream to process. |
void |
close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
connect(io.netty.channel.ChannelHandlerContext ctx,
SocketAddress remoteAddress,
SocketAddress localAddress,
io.netty.channel.ChannelPromise promise) |
void |
deregister(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
flush(io.netty.channel.ChannelHandlerContext ctx) |
boolean |
isSharable() |
void |
read(io.netty.channel.ChannelHandlerContext ctx) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise)
Encode from an
HttpObject to an Http3RequestStreamFrame. |
channelRead, channelRead, controlStream, exceptionCaught, handleHttp3Exception, handleQuicException, userEventTriggeredchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedensureNotSharable, handlerAdded, handlerRemovedpublic Http3FrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders)
public Http3FrameToHttpObjectCodec(boolean isServer)
public boolean isSharable()
isSharable in class io.netty.channel.ChannelHandlerAdapterprotected void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Http3HeadersFrame frame)
throws Exception
Http3RequestStreamInboundHandlerHttp3HeadersFrame is ready for this stream to process.channelRead in class Http3RequestStreamInboundHandlerctx - the ChannelHandlerContext of this handler.frame - the Http3HeadersFrame that was readException - thrown if an error happens during processing.protected void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Http3DataFrame frame)
throws Exception
Http3RequestStreamInboundHandlerHttp3DataFrame is ready for this stream to process.channelRead in class Http3RequestStreamInboundHandlerctx - the ChannelHandlerContext of this handler.frame - the Http3DataFrame that was readException - thrown if an error happens during processing.protected void channelInputClosed(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
Http3RequestStreamInboundHandlerchannelInputClosed in class Http3RequestStreamInboundHandlerctx - the ChannelHandlerContext of this handler.Exception - thrown if an error happens during processing.public void write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise)
throws Exception
HttpObject to an Http3RequestStreamFrame. This method will
be called for each written message that can be handled by this encoder.
NOTE: 100-Continue responses that are NOT FullHttpResponse will be rejected.write in interface io.netty.channel.ChannelOutboundHandlerctx - the ChannelHandlerContext which this handler belongs tomsg - the HttpObject message to encodeException - is thrown if an error occurspublic void flush(io.netty.channel.ChannelHandlerContext ctx)
flush in interface io.netty.channel.ChannelOutboundHandlerpublic void bind(io.netty.channel.ChannelHandlerContext ctx,
SocketAddress localAddress,
io.netty.channel.ChannelPromise promise)
bind in interface io.netty.channel.ChannelOutboundHandlerpublic void connect(io.netty.channel.ChannelHandlerContext ctx,
SocketAddress remoteAddress,
SocketAddress localAddress,
io.netty.channel.ChannelPromise promise)
connect in interface io.netty.channel.ChannelOutboundHandlerpublic void disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
disconnect in interface io.netty.channel.ChannelOutboundHandlerpublic void close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
close in interface io.netty.channel.ChannelOutboundHandlerpublic void deregister(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
deregister in interface io.netty.channel.ChannelOutboundHandlerCopyright © 2020–2024 The Netty Project. All rights reserved.