setNumProxiesToValidateConcurrently
void proxyServerPool.setNumProxiesToValidateConcurrently ( int numProxies )
Description
Set the number of proxies that can be tested concurrently.
Parameters
- numProxies Number of proxies to be validated concurrently, as an integer.
Return Values
Returns void.
Change Log
Version | Description |
---|---|
4.5 | Available for all editions. |
Examples
Test Proxies in Pool in Multiple Threads
import com.screenscraper.util.*;
// Create a new ProxyServerPool object.
proxyServerPool = new ProxyServerPool();
// Must be set on the session before other calls are made
session.setProxyServerPool(proxyServerPool);
// This tells the pool to populate itself from a file
proxyServerPool.populateFromFile( "proxies.txt" );
// screen-scraper can iterate through all of the proxies to
// ensure theyre responsive. This can be a time-consuming
// process unless it's done in a multi-threaded fashion.
// This method call tells screen-scraper to validate up to
// 25 proxies at a time.
proxyServerPool.setNumProxiesToValidateConcurrently( 25 );
// Create a new ProxyServerPool object.
proxyServerPool = new ProxyServerPool();
// Must be set on the session before other calls are made
session.setProxyServerPool(proxyServerPool);
// This tells the pool to populate itself from a file
proxyServerPool.populateFromFile( "proxies.txt" );
// screen-scraper can iterate through all of the proxies to
// ensure theyre responsive. This can be a time-consuming
// process unless it's done in a multi-threaded fashion.
// This method call tells screen-scraper to validate up to
// 25 proxies at a time.
proxyServerPool.setNumProxiesToValidateConcurrently( 25 );
scraper on 07/16/2010 at 5:21 pm
- Printer-friendly version
- Login or register to post comments