mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
use same outbound tunnel for streaming as long as possible
This commit is contained in:
parent
a25fe85b4d
commit
dda80703d2
4 changed files with 28 additions and 15 deletions
|
@ -19,6 +19,7 @@ namespace tunnel
|
|||
class InboundTunnel;
|
||||
class OutboundTunnel;
|
||||
|
||||
const int TUNNEL_EXPIRATION_THRESHOLD = 60; // 1 minute
|
||||
class TunnelPool // per local destination
|
||||
{
|
||||
public:
|
||||
|
@ -37,8 +38,8 @@ namespace tunnel
|
|||
void TunnelCreated (OutboundTunnel * createdTunnel);
|
||||
void TunnelExpired (OutboundTunnel * expiredTunnel);
|
||||
std::vector<InboundTunnel *> GetInboundTunnels (int num) const;
|
||||
OutboundTunnel * GetNextOutboundTunnel ();
|
||||
InboundTunnel * GetNextInboundTunnel ();
|
||||
OutboundTunnel * GetNextOutboundTunnel (OutboundTunnel * suggested = nullptr);
|
||||
InboundTunnel * GetNextInboundTunnel (InboundTunnel * suggested = nullptr);
|
||||
const i2p::data::IdentHash& GetIdentHash () { return m_LocalDestination.GetIdentHash (); };
|
||||
|
||||
void TestTunnels ();
|
||||
|
@ -51,7 +52,8 @@ namespace tunnel
|
|||
void RecreateInboundTunnel (InboundTunnel * tunnel);
|
||||
void RecreateOutboundTunnel (OutboundTunnel * tunnel);
|
||||
template<class TTunnels>
|
||||
typename TTunnels::value_type GetNextTunnel (TTunnels& tunnels);
|
||||
typename TTunnels::value_type GetNextTunnel (TTunnels& tunnels,
|
||||
typename TTunnels::value_type suggested = nullptr);
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue