{
try
{
String url = urls.get(i);
ContentExchange exchange = new ContentExchange(true)
{
//----------------------
// RECEIVE
//----------------------
protected void onResponseComplete() throws IOException
{
if (getResponseStatus() == 200)
{
//pe("success");
}
else
{
net.wigis.svetlin.__Print.ERROR("jetty http error: " + getResponseStatus() + ": \n" + getResponseContent());
}
String httpResponse = getResponseContent();
httpResponses.add(httpResponse);
//p("response #" + (nResponsesReceived + 1) + " of " + nTotalRequests + ": " + httpResponse.length() + " bytes");
// ------------------------------
// print
// ------------------------------
//if (nResponsesReceived == 0)
//System.out.print("[");
if (!runAtServer)
System.out.print(".");
if ((nResponsesReceived + 1) % 10 == 0)
System.out.print("(." + (nResponsesReceived + 1) + ")");
if ((nResponsesReceived + 1) == nTotalRequests)
System.out.println("]");
// ------------------------------
// LAST STATEMENT // this statement should be the last one in this method because of the async
nResponsesReceived ++;
}
};
exchange.setURL(url);
client.send(exchange);
//exchange.waitForDone();