Skip to content

Commit

Permalink
feat(plc4j/iec-60870): Fixed the problem decoding subsequent incoming…
Browse files Browse the repository at this point in the history
… messages.
  • Loading branch information
chrisdutz committed Aug 28, 2023
1 parent d740632 commit f4a6891
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -114,7 +114,7 @@ public static class ByteLengthEstimator implements ToIntFunction<ByteBuf> {
@Override
public int applyAsInt(ByteBuf byteBuf) {
if (byteBuf.readableBytes() >= 2) {
return byteBuf.getUnsignedByte( 1) + 2;
return byteBuf.getUnsignedByte( byteBuf.readerIndex() + 1) + 2;
}
return -1;
}
Expand Down

0 comments on commit f4a6891

Please sign in to comment.