Module io.netty5.codec.http
Class WebSocketClientExtensionHandler
- java.lang.Object
-
- io.netty5.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler
-
- All Implemented Interfaces:
ChannelHandler
- Direct Known Subclasses:
WebSocketClientCompressionHandler
public class WebSocketClientExtensionHandler extends Object implements ChannelHandler
This handler negotiates and initializes the WebSocket Extensions. This implementation negotiates the extension with the server in a defined order, ensures that the successfully negotiated extensions are consistent between them, and initializes the channel pipeline with the extension decoder and encoder. Find a basic implementation for compression extensions at io.netty5.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler.
-
-
Constructor Summary
Constructors Constructor Description WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker... extensionHandshakers)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelRead(ChannelHandlerContext ctx, Object msg)
Invoked when the currentChannel
has read a message from the peer.Future<Void>
write(ChannelHandlerContext ctx, Object msg)
Called once a write operation is made.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, isSharable, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown
-
-
-
-
Constructor Detail
-
WebSocketClientExtensionHandler
public WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker... extensionHandshakers)
Constructor- Parameters:
extensionHandshakers
- The extension handshaker in priority order. A handshaker could be repeated many times with fallback configuration.
-
-
Method Detail
-
write
public Future<Void> write(ChannelHandlerContext ctx, Object msg)
Description copied from interface:ChannelHandler
Called once a write operation is made. The write operation will write the messages through theChannelPipeline
. Those are then ready to be flushed to the actualChannel
onceChannel.flush()
is called.- Specified by:
write
in interfaceChannelHandler
- Parameters:
ctx
- theChannelHandlerContext
for which the write operation is mademsg
- the message to write- Returns:
- the
Future
which will be notified once the operation completes.
-
channelRead
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
Description copied from interface:ChannelHandler
Invoked when the currentChannel
has read a message from the peer.- Specified by:
channelRead
in interfaceChannelHandler
- Throws:
Exception
-
-