Top Description Fields Constructors Methods
io.netty5.handler.codec.http.websocketx.extensions

public Class WebSocketClientExtensionHandler

extends Object
implements ChannelHandler
Class Inheritance
All Implemented Interfaces
io.netty5.channel.ChannelHandler
Known Direct Subclasses
io.netty5.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler
Imports
io.netty5.channel.ChannelHandler, .ChannelHandlerContext, io.netty5.handler.codec.CodecException, io.netty5.handler.codec.http.HttpHeaderNames, .HttpRequest, .HttpResponse, io.netty5.util.concurrent.Future, java.util.ArrayList, .Arrays, .Iterator, .List

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.

Field Summary

Modifier and TypeField and Description
private final List<WebSocketClientExtensionHandshaker>

Constructor Summary

AccessConstructor and Description
public
WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker...
The extension handshaker in priority order. A handshaker could be repeated many times with fallback configuration.
extensionHandshakers
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public void
channelRead(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.
public Future<Void>
write(final ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
)

Overrides default io.netty5.channel.ChannelHandler.write.

Called once a write operation is made.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

extensionHandshakersback to summary
private final List<WebSocketClientExtensionHandshaker> extensionHandshakers

Constructor Detail

WebSocketClientExtensionHandlerback to summary
public WebSocketClientExtensionHandler(WebSocketClientExtensionHandshaker... extensionHandshakers)

Constructor

Parameters
extensionHandshakers:WebSocketClientExtensionHandshaker[]

The extension handshaker in priority order. A handshaker could be repeated many times with fallback configuration.

Method Detail

channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Doc from io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.

Annotations
@Override
writeback to summary
public Future<Void> write(final ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.write.

Doc from io.netty5.channel.ChannelHandler.write.

Called once a write operation is made. The write operation will write the messages through the ChannelPipeline. Those are then ready to be flushed to the actual Channel once Channel#flush() is called.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext for which the write operation is made

msg:Object

the message to write

Returns:Future<Void>

the Future which will be notified once the operation completes.

Annotations
@Override