Skip to content

Commit

Permalink
Select least peer active session
Browse files Browse the repository at this point in the history
  • Loading branch information
DejinChen committed Dec 24, 2024
1 parent 4865e5e commit 3d0b32d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transport/SessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,15 +1297,15 @@ Optional<SessionHandle> SessionManager::FindSecureSessionForNode(ScopedNodeId pe
{
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
// Set up a TCP transport based session as standby
if ((tcpSession == nullptr || tcpSession->GetLastActivityTime() < session->GetLastActivityTime()) &&
if ((tcpSession == nullptr || tcpSession->GetLastPeerActivityTime() < session->GetLastPeerActivityTime()) &&
session->GetTCPConnection() != nullptr)
{
tcpSession = session;
}
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
}

if ((mrpSession == nullptr) || (mrpSession->GetLastActivityTime() < session->GetLastActivityTime()))
if ((mrpSession == nullptr) || (mrpSession->GetLastPeerActivityTime() < session->GetLastPeerActivityTime()))
{
mrpSession = session;
}
Expand Down

0 comments on commit 3d0b32d

Please sign in to comment.