public class WebsocketClientHandler
extends io.netty.channel.SimpleChannelInboundHandler<java.lang.Object>
Constructor and Description |
---|
WebsocketClientHandler(java.net.URI uri,
java.lang.String remoteUniqueDeviceId,
java.util.concurrent.atomic.AtomicReference<IBlaubotIncomingConnectionListener> listenerReference)
Creates a new WebSocketClientHandler that manages the BlaubotWebsocketConnection
|
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
BlaubotWebsocketConnection |
getConnection()
Blocks until the handshake is done.
|
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
public WebsocketClientHandler(java.net.URI uri, java.lang.String remoteUniqueDeviceId, java.util.concurrent.atomic.AtomicReference<IBlaubotIncomingConnectionListener> listenerReference)
uri
- The uri to connect withremoteUniqueDeviceId
- the unique device id of the device we are connecting tolistenerReference
- a reference Object that handles the connection listenerpublic void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
handlerAdded
in interface io.netty.channel.ChannelHandler
handlerAdded
in class io.netty.channel.ChannelHandlerAdapter
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<java.lang.Object>
java.lang.Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
public BlaubotWebsocketConnection getConnection() throws java.lang.InterruptedException
java.lang.InterruptedException
- if interrupted while waiting for the handshake