Some javadocs
This commit is contained in:
parent
85a3d320cb
commit
a215ba6ef6
@ -324,6 +324,9 @@ public class LoggingHandler extends ChannelDuplexHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a String which contains all details to log the {@link ByteBuf}
|
||||||
|
*/
|
||||||
protected String formatByteBuf(String eventName, ByteBuf buf) {
|
protected String formatByteBuf(String eventName, ByteBuf buf) {
|
||||||
int length = buf.readableBytes();
|
int length = buf.readableBytes();
|
||||||
int rows = length / 16 + (length % 15 == 0? 0 : 1) + 4;
|
int rows = length / 16 + (length % 15 == 0? 0 : 1) + 4;
|
||||||
@ -375,6 +378,9 @@ public class LoggingHandler extends ChannelDuplexHandler {
|
|||||||
return dump.toString();
|
return dump.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a String which contains all details to log the {@link Object}
|
||||||
|
*/
|
||||||
protected String formatNonByteBuf(String eventName, Object msg) {
|
protected String formatNonByteBuf(String eventName, Object msg) {
|
||||||
return eventName + ": " + msg;
|
return eventName + ": " + msg;
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,9 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* if (evt instanceof {@link IdleState}} {
|
* if (evt instanceof {@link IdleState}} {
|
||||||
* {@link IdleState} e = ({@link IdleState}) evt;
|
* {@link IdleState} e = ({@link IdleState}) evt;
|
||||||
* if (e.getState() == {@link IdleState}.READER_IDLE) {
|
* if (e.getState() == {@link IdleState}.READER_IDLE) {
|
||||||
* ctx.channel().close();
|
* ctx.close();
|
||||||
* } else if (e.getState() == {@link IdleState}.WRITER_IDLE) {
|
* } else if (e.getState() == {@link IdleState}.WRITER_IDLE) {
|
||||||
* ctx.channel().write(new PingMessage());
|
* ctx.writeAndFlush(new PingMessage());
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
@ -313,6 +313,10 @@ public class IdleStateHandler extends ChannelDuplexHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when an {@link IdleStateEvent} should be fired. This implementation calls
|
||||||
|
* {@link ChannelHandlerContext#fireUserEventTriggered(Object)}.
|
||||||
|
*/
|
||||||
protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) throws Exception {
|
protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) throws Exception {
|
||||||
ctx.fireUserEventTriggered(evt);
|
ctx.fireUserEventTriggered(evt);
|
||||||
}
|
}
|
||||||
|
@ -177,6 +177,9 @@ public class ReadTimeoutHandler extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when a read timeout was detected.
|
||||||
|
*/
|
||||||
protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
|
protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
|
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
|
||||||
|
@ -133,6 +133,9 @@ public class WriteTimeoutHandler extends ChannelOutboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is called when a write timeout was detected
|
||||||
|
*/
|
||||||
protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {
|
protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception {
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);
|
ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE);
|
||||||
|
Loading…
Reference in New Issue
Block a user