public void handle(RoutingContext rc) { rc.response().headers().set("Content-Type", "application/javascript; charset=UTF-8"); BaseTransport.setCORS(rc); rc.response().setChunked(true); Buffer h = buffer(2); h.appendString("h\n"); Buffer hs = buffer(2050); for (int i = 0; i < 2048; i++) { hs.appendByte((byte) ' '); } hs.appendString("h\n"); List<TimeoutInfo> timeouts = new ArrayList<>(); setTimeout(timeouts, 0, h); setTimeout(timeouts, 1, hs); setTimeout(timeouts, 5, h); setTimeout(timeouts, 25, h); setTimeout(timeouts, 125, h); setTimeout(timeouts, 625, h); setTimeout(timeouts, 3125, h); runTimeouts(timeouts, rc.response()); } };
public void handle(RoutingContext rc) { rc.response().headers().set("Content-Type", "application/javascript; charset=UTF-8"); BaseTransport.setCORS(rc); rc.response().setChunked(true); Buffer h = buffer(2); h.appendString("h\n"); Buffer hs = buffer(2050); for (int i = 0; i < 2048; i++) { hs.appendByte((byte) ' '); } hs.appendString("h\n"); List<TimeoutInfo> timeouts = new ArrayList<>(); setTimeout(timeouts, 0, h); setTimeout(timeouts, 1, hs); setTimeout(timeouts, 5, h); setTimeout(timeouts, 25, h); setTimeout(timeouts, 125, h); setTimeout(timeouts, 625, h); setTimeout(timeouts, 3125, h); runTimeouts(timeouts, rc.response()); } };