BOB ping command

This commit is contained in:
orignal 2025-08-19 15:21:44 -04:00
parent 1c42ba85ba
commit 39069e0bd6
5 changed files with 96 additions and 1 deletions

View file

@ -1991,6 +1991,7 @@ namespace stream
void StreamingDestination::Stop ()
{
ResetAcceptor ();
ResetPongHandler ();
m_PendingIncomingTimer.cancel ();
m_PendingIncomingStreams.clear ();
{
@ -2037,6 +2038,8 @@ namespace stream
{
// pong
LogPrint (eLogInfo, "Streaming: Pong received rSID=", packet->GetReceiveStreamID ());
if (m_PongHandler != nullptr)
m_PongHandler (packet->from ? packet->from->GetDestinationPtr () : nullptr);
DeletePacket (packet);
return;
}
@ -2216,6 +2219,16 @@ namespace stream
m_Acceptor = nullptr;
}
void StreamingDestination::SetPongHandler (const PongHandler& handler)
{
m_PongHandler = handler;
}
void StreamingDestination::ResetPongHandler ()
{
m_PongHandler = nullptr;
}
void StreamingDestination::AcceptOnce (const Acceptor& acceptor)
{
boost::asio::post (m_Owner->GetService (), [acceptor, this](void)