- @Override
- protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) throws Exception {
- if (in.readableBytes() == 0) {
- LOG.debug("No more content in incoming buffer.");
- return;
- }
- try {
- LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in));
- out.add(this.registry.parseMessage(in));
- } catch (BGPParsingException | BGPDocumentedException e) {
- LOG.debug("Failed to decode protocol message", e);
- this.exceptionCaught(ctx, e);
- }
- }
+ @Override
+ protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) throws BGPDocumentedException,
+ BGPParsingException {
+ if (in.isReadable()) {
+ LOG.trace("Received to decode: {}", ByteBufUtil.hexDump(in));
+ out.add(this.registry.parseMessage(in));
+ } else {
+ LOG.trace("No more content in incoming buffer.");
+ }
+ }