mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
create inbound tunnels per local destination
This commit is contained in:
parent
7caa46b381
commit
cba18faa87
7 changed files with 112 additions and 12 deletions
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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue