MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / TcpSetKeepaliveTimer

Function TcpSetKeepaliveTimer

NetworkPkg/TcpDxe/TcpTimer.c:452–480  ·  view source on GitHub ↗

Enable the keepalive timer and set the timeout value. @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance. **/

Source from the content-addressed store, hash-verified

450
451**/
452VOID
453TcpSetKeepaliveTimer (
454 IN OUT TCP_CB *Tcb
455 )
456{
457 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_KEEPALIVE)) {
458 return ;
459
460 }
461
462 //
463 // Set the timer to KeepAliveIdle if either
464 // 1. the keepalive timer is off
465 // 2. The keepalive timer is on, but the idle
466 // is less than KeepAliveIdle, that means the
467 // connection is alive since our last probe.
468 //
469 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_KEEPALIVE) ||
470 (Tcb->Idle < Tcb->KeepAliveIdle)
471 ) {
472
473 TcpSetTimer (Tcb, TCP_TIMER_KEEPALIVE, Tcb->KeepAliveIdle);
474 Tcb->KeepAliveProbes = 0;
475
476 } else {
477
478 TcpSetTimer (Tcb, TCP_TIMER_KEEPALIVE, Tcb->KeepAlivePeriod);
479 }
480}
481
482/**
483 Heart beat timer handler.

Callers 2

TcpInputFunction · 0.85
TcpKeepaliveTimeoutFunction · 0.85

Calls 1

TcpSetTimerFunction · 0.85

Tested by

no test coverage detected