public class ClientHandshakeHandler
extends io.netty.channel.ChannelDuplexHandler
Modifier and Type | Class and Description |
---|---|
static class |
ClientHandshakeHandler.ClientHandshakeEvent
Events that the handshaker sends to downstream handlers.
|
Constructor and Description |
---|
ClientHandshakeHandler(UUID clientId,
UUID serverId,
int handshakeTimeout)
Creates a new ClientHandshakeHandler which will handle the handshake between the
current client and a remote server.
|
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx)
Channel event that is triggered when a new connected channel is created.
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
Channel event that is triggered when the channel is closed.
|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object m)
Read data from the Channel.
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
Channel event that is triggered when an exception is caught.
|
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise)
Channel event that is triggered when an outbound handler attempts to write into the channel.
|
bind, close, connect, deregister, disconnect, flush, read
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public ClientHandshakeHandler(@NonNull UUID clientId, UUID serverId, int handshakeTimeout)
clientId
- Current Client Identifier.serverId
- Remote Server Identifier to connect to.public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object m) throws Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
ctx
- channel handler contextm
- object received in inbound bufferException
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
ctx
- channel handler contextException
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
ctx
- channel handler contextException
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
ctx
- channel handler contextcause
- exception causeException
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception
write
in interface io.netty.channel.ChannelOutboundHandler
write
in class io.netty.channel.ChannelDuplexHandler
ctx
- channel handler contextmsg
- message written into channelpromise
- channel promiseException
Copyright © 2019 CorfuDB. All rights reserved.