final CountDownLatch latch = new CountDownLatch(2);
atmoServlet.addAtmosphereHandler(ROOT, new AbstractHttpAtmosphereHandler() {
AtomicBoolean b = new AtomicBoolean(false);
AtomicInteger count = new AtomicInteger(0);
private long currentTime;
public void onRequest(AtmosphereResource<HttpServletRequest, HttpServletResponse> event) throws IOException
{
if (!b.getAndSet(true)) {
event.suspend(-1, false);
} else {
currentTime = System.currentTimeMillis();