//Send the firehose messages to all registered connections.
long num = 0;
while (true) {
//build the response.
ResponseBuilder res = new ResponseBuilder();
res.txnStatusContinue();//lets the client know to expect more messages.
//set the content message.
res.contentUTF8("this is message number: " + num++ + "\r\nThere are " + connections.size() + " concurrent connections");
//send it to all connections
connections.sendMessage(res.getResponse());
Sleep.millis(500);