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

Method HandleSessionReadinessCheckTimer

libi2pd_client/SAM.cpp:487–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485 }
486
487 void SAMSocket::HandleSessionReadinessCheckTimer (const boost::system::error_code& ecode)
488 {
489 if (ecode != boost::asio::error::operation_aborted)
490 {
491 if (m_Socket.is_open ())
492 {
493 auto session = m_Owner.FindSession(m_ID);
494 if(session)
495 {
496 if (session->GetLocalDestination ()->IsReady ())
497 SendSessionCreateReplyOk ();
498 else
499 {
500 m_Timer.expires_after (std::chrono::seconds(SAM_SESSION_READINESS_CHECK_INTERVAL));
501 m_Timer.async_wait (std::bind (&SAMSocket::HandleSessionReadinessCheckTimer,
502 shared_from_this (), std::placeholders::_1));
503 }
504 }
505 }
506 else
507 Terminate ("SAM: session socket closed");
508 }
509 }
510
511 void SAMSocket::SendSessionCreateReplyOk ()
512 {

Callers

nothing calls this directly

Calls 3

IsReadyMethod · 0.80
FindSessionMethod · 0.45
GetLocalDestinationMethod · 0.45

Tested by

no test coverage detected