use of com.ms.silverking.cloud.dht.net.MessageGroup in project SilverKing by Morgan-Stanley.
the class MessageGroupTest method runQueueingConnectionTestClient.
private void runQueueingConnectionTestClient(double durationSeconds) throws IOException {
MessageGroup msg;
Stopwatch sw;
Stopwatch displaySW;
// msg = createMessage(NumConversion.intToBytes(index));
sw = new SimpleStopwatch();
displaySW = new SimpleStopwatch();
do {
msg = createMessage(NumConversion.intToBytes(clientPort));
// System.out.println("Sending");
messagesSent.incrementAndGet();
paServer.send(serverAddr, msg, false, Long.MAX_VALUE);
try {
semaphore.acquire();
} catch (InterruptedException ie) {
}
// rewindBuffers(msg);
if (displaySW.getSplitSeconds() > displayIntervalSeconds) {
displayStats(sw.getSplitSeconds());
displaySW.reset();
}
} while (sw.getSplitSeconds() < durationSeconds);
sw.stop();
displayStats(sw.getElapsedSeconds());
}
Aggregations