tcp: Make retransmission timeout (RTO) configurable

This commit is contained in:
yuanjm
2020-04-15 10:26:04 +08:00
committed by Erik Ekman
parent 876517ea3e
commit 239918ccc1
2 changed files with 13 additions and 2 deletions

View File

@@ -1901,8 +1901,10 @@ tcp_alloc(u8_t prio)
/* As initial send MSS, we use TCP_MSS but limit it to 536.
The send MSS is updated when an MSS option is received. */
pcb->mss = INITIAL_MSS;
pcb->rto = 3000 / TCP_SLOW_INTERVAL;
pcb->sv = 3000 / TCP_SLOW_INTERVAL;
/* Set initial TCP's retransmission timeout to 3000 ms by default.
This value could be configured in lwipopts */
pcb->rto = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL;
pcb->sv = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL;
pcb->rtime = -1;
pcb->cwnd = 1;
pcb->tmr = tcp_ticks;