resp.setHeader("XDomainRequestAllowed", "1"); // allow this so we can support streaming in IE8
//final ServletOutputStream outStream = resp.getOutputStream();
// System.err.println("eventStream.ping" + eventStream.pingCallback);
boolean writtenTo = false;
while (!writtenTo || serializer.isStreamingAvailable() || eventStream.eventAvailable()) {
notification = suspend(eventStream, req); // implementation specific handling
if (notification == null) // if the suspend returns null, the suspend will resume the operation
return;
serializer.sendNotification(notification, (Client) eventStream,!writtenTo);