As stated in the question, is it necessary to close a Netty ChunkedInput
after sending its data through ChannelHandlerContext.writeAndFlush()
? I know this operation is asynchronous so probably I am not supposed to close it immediately after calling writeAndFlush()
, therefore do I need to add a FutureListener
to close it?
In the official File server example, I fuond that the the close()
function of the ChunkedInput
is not called:
sendFileFuture = ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)), ctx.newProgressivePromise());
Does it mean that the ChunkedInput
is closed automatically when all the data is read, or does the channel actually help me close it?