Commit f29e9519 authored by bornholdt's avatar bornholdt
Browse files

!

parent 22b52df5
Pipeline #86902 passed with stages
in 8 minutes and 24 seconds
......@@ -93,10 +93,9 @@ public class StopAndWaitArqHandler extends ChannelDuplexHandler {
final Object msg) {
if (msg instanceof StopAndWaitArqData) {
final StopAndWaitArqData data = (StopAndWaitArqData) msg;
LOG.trace("[{}] Got {}", ctx.channel().id().asShortText(), data);
if (inboundSequenceNo == data.sequenceNo()) {
LOG.trace("DATA ja");
LOG.trace("[{}] Got expected {}. Pass through DATA.", ctx.channel().id().asShortText(), data);
// expected sequence no -> pass DATA inbound
ctx.fireChannelRead(msg);
......@@ -104,7 +103,7 @@ public class StopAndWaitArqHandler extends ChannelDuplexHandler {
inboundSequenceNo = !inboundSequenceNo;
}
else {
LOG.trace("DATA nein");
LOG.trace("[{}] Got unexpected {}. Drop DATA.", ctx.channel().id().asShortText(), data);
}
// reply with ACK
......@@ -112,16 +111,15 @@ public class StopAndWaitArqHandler extends ChannelDuplexHandler {
}
else if (msg instanceof StopAndWaitArqAck) {
final StopAndWaitArqAck ack = (StopAndWaitArqAck) msg;
LOG.trace("[{}] Got {}", ctx.channel().id().asShortText(), ack);
final Boolean outboundSequenceNo = outboundSequenceNo();
if (outboundSequenceNo != null && outboundSequenceNo == ack.sequenceNo()) {
LOG.trace("ACK ja");
LOG.trace("[{}] Got expected {}. Succeed DATA.", ctx.channel().id().asShortText(), ack);
succeedCurrentWrite();
writeNextPending(ctx);
}
else {
LOG.trace("ACK nein");
LOG.trace("[{}] Got unexpected {}. Ignore.", ctx.channel().id().asShortText(), ack);
}
}
else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment