I am using Netty in one of my projects. There is a flow in which I have to send some data to the client from some other thread (other netty's worker thread):
final ChannelFuture writeAndFlushFuture = ctx.channel().writeAndFlush(out)
.addListener(new GenericFutureListener<Future<? super Void>>() {
@Override
public void operationComplete(Future<? super Void> future) throws Exception {
LOGGER.info("=========> dsgdsfgdsfgdfsgdfsgsdgfd");
}
});
Also, I am waiting on client response after it receives my payload. I associated a timeout with it as well, so that whenever client doesn't reply back within time frame, I close the context from the server (assuming erroneous connection).
There is something strange going on. Whenever I send the payload to the client, I am not getting this printed in my logs
dsgdsfgdsfgdfsgdfsgsdgfd
But, it's getting printed just before I am closing the connection due to timeout. I am not sure what I might be doing wrong as to not send the payload right away, but just before closing the connection.
What could be happening here?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…