pick tunnels from exploratory pool for exploratory

This commit is contained in:
orignal 2014-04-03 16:27:37 -04:00
parent 13b2036e52
commit 24f0ff6c00
4 changed files with 23 additions and 3 deletions

View file

@ -86,7 +86,22 @@ namespace tunnel
m_LastOutboundTunnel = tunnel;
return tunnel;
}
InboundTunnel * TunnelPool::GetNextInboundTunnel ()
{
return GetNextTunnel (m_InboundTunnels);
}
template<class TTunnels>
typename TTunnels::value_type TunnelPool::GetNextTunnel (TTunnels& tunnels)
{
if (tunnels.empty ()) return nullptr;
for (auto it: tunnels)
if (!it->IsFailed ())
return it;
return nullptr;
}
void TunnelPool::CreateTunnels ()
{
int num = m_InboundTunnels.size ();