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 void
channelRead0
(ChannelHandlerContext ctx, WebSocketFrame frame) Handles incoming WebSocket frames and passes them to the appropriateWsFrameHandler
void
exceptionCaught
(ChannelHandlerContext ctx, Throwable cause) Handles exceptions that are thrown up the stackvoid
userEventTriggered
(ChannelHandlerContext ctx, Object evt) CapturesWebSocketServerProtocolHandler.HandshakeComplete
events and saves theWsFrameHandler
URI to the session If a handler is not available for the requested path, then404 NOT FOUND
is sent back to the client using JSON:API formatMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
channelRead0
in classSimpleChannelInboundHandler<WebSocketFrame>
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionframe
- TheWebSocketFrame
containing the request frame- Throws:
Exception
- Passes any thrown exceptions up the stack
-
userEventTriggered
CapturesWebSocketServerProtocolHandler.HandshakeComplete
events and saves theWsFrameHandler
URI to the session If a handler is not available for the requested path, then404 NOT FOUND
is sent back to the client using JSON:API format- Specified by:
userEventTriggered
in interfaceChannelInboundHandler
- Overrides:
userEventTriggered
in classChannelInboundHandlerAdapter
- Parameters:
ctx
- TheChannelHandlerContext
of 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:
exceptionCaught
in interfaceChannelHandler
- Specified by:
exceptionCaught
in interfaceChannelInboundHandler
- Overrides:
exceptionCaught
in classChannelInboundHandlerAdapter
- Parameters:
ctx
- TheChannelHandlerContext
of the sessioncause
- The exception
-