// We are going to use this object to synchronize between the
// I/O event and main threads
CountDownLatch requestCount = new CountDownLatch(3);
BufferingHttpClientHandler handler = new BufferingHttpClientHandler(
httpproc,
new MyHttpRequestExecutionHandler(requestCount),
new DefaultConnectionReuseStrategy(),
params);
handler.setEventListener(new EventLogger());
final IOEventDispatch ioEventDispatch = new DefaultClientIOEventDispatch(handler, params);
Thread t = new Thread(new Runnable() {