// while the previous drain was being processed.
streamMessages(notifier.drainMessages(), os, res);
notifier.pushNeeded.wait(serverToClientHeartbeatMillis);
List messages = notifier.drainMessages();
// If there are no messages to send to the client, send an null
// byte as a heartbeat to make sure the client is still valid.
if (messages == null && serverToClientHeartbeatMillis > 0)
{
try