Package com.gmt2001.httpwsserver
Class WsSslErrorHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<WebSocketFrame>
com.gmt2001.httpwsserver.WsSslErrorHandler
- All Implemented Interfaces:
ChannelHandler,ChannelInboundHandler
Processes WebSocket frames and passes successful ones to the appropriate registered final handler
- Author:
- gmt2001
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchannelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) Handles incoming WebSocket frames and passes them to the appropriateWsFrameHandlervoidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) Handles exceptions that are thrown up the stackvoiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CapturesWebSocketServerProtocolHandler.HandshakeCompleteevents and saves theWsFrameHandlerURI to the session If a handler is not available for the requested path, then404 NOT FOUNDis sent back to the client using JSON:API formatMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
ALLOWNONSSLPATHS
-
-
Method Details
-
channelRead0
Handles incoming WebSocket frames and passes them to the appropriateWsFrameHandler- Specified by:
channelRead0in classSimpleChannelInboundHandler<WebSocketFrame>- Parameters:
ctx- TheChannelHandlerContextof the sessionframe- TheWebSocketFramecontaining the request frame- Throws:
Exception- Passes any thrown exceptions up the stack
-
userEventTriggered
CapturesWebSocketServerProtocolHandler.HandshakeCompleteevents and saves theWsFrameHandlerURI to the session If a handler is not available for the requested path, then404 NOT FOUNDis sent back to the client using JSON:API format- Specified by:
userEventTriggeredin interfaceChannelInboundHandler- Overrides:
userEventTriggeredin classChannelInboundHandlerAdapter- Parameters:
ctx- TheChannelHandlerContextof the sessionevt- The event object- Throws:
Exception- Passes any thrown exceptions up the stack
-
exceptionCaught
Handles exceptions that are thrown up the stack- Specified by:
exceptionCaughtin interfaceChannelHandler- Specified by:
exceptionCaughtin interfaceChannelInboundHandler- Overrides:
exceptionCaughtin classChannelInboundHandlerAdapter- Parameters:
ctx- TheChannelHandlerContextof the sessioncause- The exception
-