@Override protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse, InetSocketAddress> in, List<Object> out) throws Exception { final InetSocketAddress recipient = in.recipient(); final DnsResponse response = in.content(); final ByteBuf buf = allocateBuffer(ctx, in); boolean success = false; try { encodeHeader(response, buf); encodeQuestions(response, buf); encodeRecords(response, DnsSection.ANSWER, buf); encodeRecords(response, DnsSection.AUTHORITY, buf); encodeRecords(response, DnsSection.ADDITIONAL, buf); success = true; } finally { if (!success) { buf.release(); } } out.add(new DatagramPacket(buf, recipient, null)); }
@Override protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse, InetSocketAddress> in, List<Object> out) throws Exception { final InetSocketAddress recipient = in.recipient(); final DnsResponse response = in.content(); final ByteBuf buf = allocateBuffer(ctx, in); boolean success = false; try { encodeHeader(response, buf); encodeQuestions(response, buf); encodeRecords(response, DnsSection.ANSWER, buf); encodeRecords(response, DnsSection.AUTHORITY, buf); encodeRecords(response, DnsSection.ADDITIONAL, buf); success = true; } finally { if (!success) { buf.release(); } } out.add(new DatagramPacket(buf, recipient, null)); }
@Override protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse, InetSocketAddress> in, List<Object> out) throws Exception { final InetSocketAddress recipient = in.recipient(); final DnsResponse response = in.content(); final ByteBuf buf = allocateBuffer(ctx, in); boolean success = false; try { encodeHeader(response, buf); encodeQuestions(response, buf); encodeRecords(response, DnsSection.ANSWER, buf); encodeRecords(response, DnsSection.AUTHORITY, buf); encodeRecords(response, DnsSection.ADDITIONAL, buf); success = true; } finally { if (!success) { buf.release(); } } out.add(new DatagramPacket(buf, recipient, null)); }
@Override protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse, InetSocketAddress> in, List<Object> out) throws Exception { final InetSocketAddress recipient = in.recipient(); final DnsResponse response = in.content(); final ByteBuf buf = allocateBuffer(ctx, in); boolean success = false; try { encodeHeader(response, buf); encodeQuestions(response, buf); encodeRecords(response, DnsSection.ANSWER, buf); encodeRecords(response, DnsSection.AUTHORITY, buf); encodeRecords(response, DnsSection.ADDITIONAL, buf); success = true; } finally { if (!success) { buf.release(); } } out.add(new DatagramPacket(buf, recipient, null)); }
@Override protected void encode(ChannelHandlerContext ctx, AddressedEnvelope<DnsResponse, InetSocketAddress> in, List<Object> out) throws Exception { final InetSocketAddress recipient = in.recipient(); final DnsResponse response = in.content(); final ByteBuf buf = allocateBuffer(ctx, in); boolean success = false; try { encodeHeader(response, buf); encodeQuestions(response, buf); encodeRecords(response, DnsSection.ANSWER, buf); encodeRecords(response, DnsSection.AUTHORITY, buf); encodeRecords(response, DnsSection.ADDITIONAL, buf); success = true; } finally { if (!success) { buf.release(); } } out.add(new DatagramPacket(buf, recipient, null)); }