public Proxy GetAvalibleProxy()
{
lock (_proxies)
{
Proxy selectedProxy = null;
do
{
if (_proxies.Count(t => t.IsOnline) == 0)
throw new AllProxiesBannedException();
selectedProxy = _proxies.FirstOrDefault(t => t.IsOnline && !t.IsBusy);
if (selectedProxy == null)
{
Thread.Sleep(35);
}
} while (selectedProxy == null);
selectedProxy.IsBusy = true;
return selectedProxy;
}
}
/// <summary>