outbound tunnel pool

This commit is contained in:
orignal 2014-03-16 16:03:20 -04:00
parent 9ef8ae99e2
commit c9ba7da0b0
6 changed files with 74 additions and 7 deletions

View file

@ -29,19 +29,24 @@ namespace tunnel
void CreateTunnels ();
void TunnelCreated (InboundTunnel * createdTunnel);
void TunnelExpired (InboundTunnel * expiredTunnel);
void TunnelCreated (OutboundTunnel * createdTunnel);
void TunnelExpired (OutboundTunnel * expiredTunnel);
std::vector<InboundTunnel *> GetInboundTunnels (int num) const;
OutboundTunnel * GetNextOutboundTunnel ();
private:
void CreateInboundTunnel ();
void CreateOutboundTunnel ();
private:
uint8_t m_EncryptionPublicKey[256], m_EncryptionPrivateKey[256];
i2p::data::LocalDestination * m_LocalDestination;
int m_NumTunnels;
std::set<InboundTunnel *, TunnelCreationTimeCmp> m_InboundTunnels; // recent tunnel appears first
std::set<OutboundTunnel *, TunnelCreationTimeCmp> m_OutboundTunnels;
OutboundTunnel * m_LastOutboundTunnel;
};
}
}