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, channelReadchannelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredpublic 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.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterpublic 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.Exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause)
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterpublic BlaubotWebsocketConnection getConnection() throws java.lang.InterruptedException
java.lang.InterruptedException - if interrupted while waiting for the handshake