| 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 | { |
no test coverage detected