Opened 3 weeks ago

Last modified 5 days ago

#2654 new enhancement

PeerState.java: remove _retransmitter

Reported by: jogger Owned by: zzz
Priority: minor Milestone: undecided
Component: router/transport Version: 0.9.43
Keywords: Cc:
Parent Tickets: #2649 Sensitive: no

Description

Maintaining that field is pure code bloat as it simply duplicates what we have in the state pushcount. Also does not work if we want multiple retransmissions.

Subtickets

Change History (2)

comment:1 Changed 7 days ago by zzz

Parent Tickets: 2649
Status: newinfoneeded_new

Seems to be two uses now, not convinced of "pure code bloat', please explain.

1) Is a message being retransmitted now? in locked_shouldSend(), maybe could be replaced by a boolean
2) What's the next send time, in getNextDelay(), uses the _retransmitter.getNextSendTime(), i don't see how to get rid of that. Have a proposal?

required for #2649

comment:2 Changed 5 days ago by jogger

Status: infoneeded_newnew

If we have multiple retransmissions, we would record those. Code (including fast retransmission for which I still need to open a ticket) for 1) could be

        int pc = state.getPushCount();
        // send fresh messages if retransmissions below limit
        // retransmit first time if retransmissions below limit AND (fast retransmit OR time due)
        // send retransmitters always if time due
        if (_retranscount < _retransmax && (pc == 0 ||
            pc == 1 && (state.getStartedOn() < _lastSendFullyTime || state.getNextSendTime() <= now))
            || pc > 1 && state.getNextSendTime() <= now) {

As noted in #2412 I would use a getNextSendTime(), suggesting this for 2):

                for (OutboundMessageState state : _outboundMessages)
                    if (_retranscount < _retransmax || state.getPushCount() > 1)
                        _nextSendTime = Math.min(_nextSendTime, state.getNextSendTime());
Note: See TracTickets for help on using tickets.