Package io.karatelabs.http
Class WsClientHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Object>
io.karatelabs.http.WsClientHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
Netty handler for WebSocket client connections.
Public for extension by subclasses.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWsClientHandler(WsClient client, io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) io.netty.channel.ChannelPromisevoidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) protected voidonBinaryFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame frame) protected voidonCloseFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.CloseWebSocketFrame frame) protected voidonPingFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.PingWebSocketFrame frame) protected voidonPongFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.PongWebSocketFrame frame) protected voidonTextFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame frame) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, 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
handlerRemoved
-
Field Details
-
client
-
-
Constructor Details
-
WsClientHandler
public WsClientHandler(WsClient client, io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker handshaker)
-
-
Method Details
-
getHandshakeFuture
public io.netty.channel.ChannelPromise getHandshakeFuture() -
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead0
-
onTextFrame
protected void onTextFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame frame) -
onBinaryFrame
protected void onBinaryFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame frame) -
onPingFrame
protected void onPingFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.PingWebSocketFrame frame) -
onPongFrame
protected void onPongFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.PongWebSocketFrame frame) -
onCloseFrame
protected void onCloseFrame(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.CloseWebSocketFrame frame) -
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-