Class TtyWebSocketFrameHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.websocketx.TextWebSocketFrame>
org.aesh.terminal.http.netty.TtyWebSocketFrameHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
public class TtyWebSocketFrameHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.websocketx.TextWebSocketFrame>
Netty handler for processing WebSocket frames and managing TTY connections.
- Author:
- Julien Viet
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionTtyWebSocketFrameHandler(io.netty.channel.group.ChannelGroup group, Consumer<Connection> handler) Creates a new WebSocket frame handler with the specified channel group and connection handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame msg) Processes incoming WebSocket text frames and writes them to the connection decoder.voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
TtyWebSocketFrameHandler
public TtyWebSocketFrameHandler(io.netty.channel.group.ChannelGroup group, Consumer<Connection> handler) Creates a new WebSocket frame handler with the specified channel group and connection handler.- Parameters:
group- the channel group for managing active channelshandler- the handler to invoke when a connection is established
-
-
Method Details
-
channelActive
-
userEventTriggered
-
channelInactive
-
channelRead0
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame msg) throws Exception Processes incoming WebSocket text frames and writes them to the connection decoder.- Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.websocketx.TextWebSocketFrame>- Parameters:
ctx- the channel handler contextmsg- the text WebSocket frame- Throws:
Exception- if an error occurs during processing
-