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

Method SendMsg

libi2pd/Datagram.cpp:556–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554 }
555
556 void DatagramSession::SendMsg(std::shared_ptr<I2NPMessage> msg)
557 {
558 // we used this session
559 m_LastUse = i2p::util::GetMillisecondsSinceEpoch();
560 if (msg || m_SendQueue.empty ())
561 m_SendQueue.push_back(msg);
562 // flush queue right away if full
563 if (!msg || m_SendQueue.size() >= DATAGRAM_SEND_QUEUE_MAX_SIZE ||
564 m_LastUse > m_LastFlush + DATAGRAM_MAX_FLUSH_INTERVAL)
565 {
566 FlushSendQueue();
567 m_LastFlush = m_LastUse;
568 }
569 }
570
571 DatagramSession::Info DatagramSession::GetSessionInfo() const
572 {

Callers 2

SendDatagramMethod · 0.45
SendRawDatagramMethod · 0.45

Calls 2

push_backMethod · 0.80

Tested by

no test coverage detected