create inbound tunnels per local destination

This commit is contained in:
orignal 2014-03-14 15:13:34 -04:00
parent 7caa46b381
commit cba18faa87
7 changed files with 112 additions and 12 deletions

View file

@ -1,8 +1,12 @@
#ifndef TUNNEL_POOL__
#define TUNNEL_POOL__
#include <list>
#include <set>
#include <vector>
#include "Identity.h"
#include "LeaseSet.h"
#include "I2NPProtocol.h"
#include "TunnelBase.h"
namespace i2p
{
@ -16,15 +20,25 @@ namespace tunnel
{
public:
TunnelPool ();
TunnelPool (i2p::data::LocalDestination * owner, int numTunnels = 5);
~TunnelPool ();
void CreateTunnels ();
std::vector<InboundTunnel *> GetInboundTunnels (int num) const;
void TunnelCreationFailed (Tunnel * failedTunnel);
void TunnelExpired (InboundTunnel * expiredTunnel);
void TunnelCreated (InboundTunnel * createdTunnel);
private:
void CreateInboundTunnel ();
private:
std::list<InboundTunnel *> m_InboundTunnels;
i2p::data::LocalDestination * m_Owner;
int m_NumTunnels;
std::set<InboundTunnel *, TunnelCreationTimeCmp> m_InboundTunnels; // recent tunnel appears first
};
}
}