create inbound tunnels per local destination
This commit is contained in:
20
TunnelPool.h
20
TunnelPool.h
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user