List of usage examples for io.netty.channel ChannelPipeline writeAndFlush
ChannelFuture writeAndFlush(Object msg);
From source file:com.tesora.dve.server.connectionmanager.loaddata.MSPLoadDataDecoder.java
License:Open Source License
private void sendResponseAndRemove(ChannelHandlerContext ctx) { ChannelPipeline pipeline = ctx.pipeline(); try {//w w w .j a v a 2s . com pauseInput(ctx);//stop incoming packets so we don't process the next request, we'll resume in the removal callback. MyMessage response; if (encounteredError == null) response = createLoadDataEOFMsg(myLoadDataInfileContext); else response = new MyErrorResponse(new PEException(encounteredError)); pipeline.writeAndFlush(response); pipeline.remove(this); } catch (Exception e) { ctx.channel().close(); } }