MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / CloseSession

Method CloseSession

libi2pd_client/SAM.cpp:1571–1590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1569 }
1570
1571 void SAMBridge::CloseSession (std::string_view id)
1572 {
1573 std::shared_ptr<SAMSession> session;
1574 {
1575 std::unique_lock<std::mutex> l(m_SessionsMutex);
1576 auto it = m_Sessions.find (id);
1577 if (it != m_Sessions.end ())
1578 {
1579 session = it->second;
1580 m_Sessions.erase (it);
1581 }
1582 }
1583 if (session)
1584 {
1585 session->StopLocalDestination ();
1586 session->Close ();
1587 if (m_IsSingleThread)
1588 ScheduleSessionCleanupTimer (session); // let all session's streams close
1589 }
1590 }
1591
1592 void SAMBridge::ScheduleSessionCleanupTimer (std::shared_ptr<SAMSession> session)
1593 {

Callers 3

TerminateMethod · 0.80
ProcessSessionRemoveMethod · 0.80
CloseMethod · 0.80

Calls 2

StopLocalDestinationMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected