Permalink
Browse files

Fixed hub bench sample to ensure order server side.

  • Loading branch information...
1 parent 17df722 commit 9874b1e18f45b33f6bdca86a51bc4d41b820624f @davidfowl davidfowl committed Apr 11, 2012
@@ -13,18 +13,20 @@ public void HitMe(long start, int clientCalls, string connectionId)
{
for (int i = 0; i < clientCalls; i++)
{
- Clients[connectionId].stepOne();
+ Clients[connectionId].stepOne().Wait();
}
- Clients[connectionId].doneOne(start, clientCalls);
+
+ Clients[connectionId].doneOne(start, clientCalls).Wait();
}
public void HitUs(long start, int clientCalls)
{
for (int i = 0; i < clientCalls; i++)
{
- Clients.stepAll();
+ Clients.stepAll().Wait();
}
- Clients.doneAll(start, clientCalls, Connections);
+
+ Clients.doneAll(start, clientCalls, Connections).Wait();
}
public Task Connect()
@@ -22,7 +22,7 @@
$(function () {
function log(message) {
var $newMessage = $("<li/>", { text: message });
- $("#messages").append($newMessage);
+ $("#messages").prepend($newMessage);
return $newMessage;
};
@@ -33,6 +33,7 @@
bench.stepOne = function () {
++countOne;
};
+
bench.doneOne = function (start, expected) {
var duration = new Date().getTime() - start;
var $msg = log(countOne + " in " + duration + "ms");

0 comments on commit 9874b1e

Please sign in to comment.