Skip to content

Commit 4ffee5c

Browse files
committed
Enable TCP Keepalive for the received connection on the Server.
The TCP KeepAlive was enabled on the client side. Enable TCP Keepalive from the server side as well.
1 parent ba949bf commit 4ffee5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/transport/raw/TCP.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ void TCPBase::HandleIncomingConnection(Inet::TCPEndPoint * listenEndPoint, Inet:
578578
tcp->mUsedEndPointCount++;
579579
activeConnection->mConnectionState = TCPState::kConnected;
580580

581+
// Set the TCPKeepalive configurations on the received connection
582+
endPoint->EnableKeepAlive(activeConnection->mTCPKeepAliveIntervalSecs, activeConnection->mTCPMaxNumKeepAliveProbes);
583+
581584
char addrStr[Transport::PeerAddress::kMaxToStringSize];
582585
peerAddress.ToString(addrStr);
583586
ChipLogProgress(Inet, "Incoming connection established with peer at %s.", addrStr);

0 commit comments

Comments
 (0)