Class WebSocketClientProtocolHandshakeHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandshakeHandler
-
- All Implemented Interfaces:
ChannelHandler,ChannelInboundHandler
class WebSocketClientProtocolHandshakeHandler extends ChannelInboundHandlerAdapter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelHandlerContextctxprivate static longDEFAULT_HANDSHAKE_TIMEOUT_MSprivate ChannelPromisehandshakePromiseprivate WebSocketClientHandshakerhandshakerprivate longhandshakeTimeoutMillis
-
Constructor Summary
Constructors Constructor Description WebSocketClientProtocolHandshakeHandler(WebSocketClientHandshaker handshaker)WebSocketClientProtocolHandshakeHandler(WebSocketClientHandshaker handshaker, long handshakeTimeoutMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidapplyHandshakeTimeout()voidchannelActive(ChannelHandlerContext ctx)CallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidchannelRead(ChannelHandlerContext ctx, java.lang.Object msg)CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.(package private) ChannelFuturegetHandshakeFuture()This method is visible for testing.voidhandlerAdded(ChannelHandlerContext ctx)Do nothing by default, sub-classes may override this method.-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
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 Detail
-
DEFAULT_HANDSHAKE_TIMEOUT_MS
private static final long DEFAULT_HANDSHAKE_TIMEOUT_MS
- See Also:
- Constant Field Values
-
handshaker
private final WebSocketClientHandshaker handshaker
-
handshakeTimeoutMillis
private final long handshakeTimeoutMillis
-
ctx
private ChannelHandlerContext ctx
-
handshakePromise
private ChannelPromise handshakePromise
-
-
Constructor Detail
-
WebSocketClientProtocolHandshakeHandler
WebSocketClientProtocolHandshakeHandler(WebSocketClientHandshaker handshaker)
-
WebSocketClientProtocolHandshakeHandler
WebSocketClientProtocolHandshakeHandler(WebSocketClientHandshaker handshaker, long handshakeTimeoutMillis)
-
-
Method Detail
-
handlerAdded
public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceChannelHandler- Overrides:
handlerAddedin classChannelHandlerAdapter- Throws:
java.lang.Exception
-
channelActive
public void channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelActivein interfaceChannelInboundHandler- Overrides:
channelActivein classChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelRead
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelReadin interfaceChannelInboundHandler- Overrides:
channelReadin classChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
applyHandshakeTimeout
private void applyHandshakeTimeout()
-
getHandshakeFuture
ChannelFuture getHandshakeFuture()
This method is visible for testing.- Returns:
- current handshake future
-
-