Class WebSocketServerProtocolHandshakeHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandshakeHandler
- All Implemented Interfaces:
ChannelHandler
,ChannelInboundHandler
Handles the HTTP handshake (the HTTP Upgrade request) for
WebSocketServerProtocolHandler
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelHandlerContext
private ChannelPromise
private boolean
private final WebSocketServerProtocolConfig
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
channelRead
(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)
to forward to the nextChannelInboundHandler
in theChannelPipeline
.private boolean
checkNextUri
(String uri, String websocketPath) private static String
getWebSocketLocation
(ChannelPipeline cp, HttpRequest req, String path) void
Do nothing by default, sub-classes may override this method.private boolean
private static void
sendHttpResponse
(ChannelHandlerContext ctx, HttpRequest req, HttpResponse res) Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, 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
handlerRemoved
-
Field Details
-
serverConfig
-
ctx
-
handshakePromise
-
isWebSocketPath
private boolean isWebSocketPath
-
-
Constructor Details
-
WebSocketServerProtocolHandshakeHandler
WebSocketServerProtocolHandshakeHandler(WebSocketServerProtocolConfig serverConfig)
-
-
Method Details
-
handlerAdded
Description copied from class:ChannelHandlerAdapter
Do nothing by default, sub-classes may override this method.- Specified by:
handlerAdded
in interfaceChannelHandler
- Overrides:
handlerAdded
in classChannelHandlerAdapter
-
channelRead
Description copied from class:ChannelInboundHandlerAdapter
CallsChannelHandlerContext.fireChannelRead(Object)
to forward to the nextChannelInboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
channelRead
in interfaceChannelInboundHandler
- Overrides:
channelRead
in classChannelInboundHandlerAdapter
- Throws:
Exception
-
isWebSocketPath
-
checkNextUri
-
sendHttpResponse
-
getWebSocketLocation
-
applyHandshakeTimeout
private void applyHandshakeTimeout()
-