From 73d2bd1741c45bf08438c25b9c4f9e785a26bba6 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Sat, 28 Aug 2010 02:30:17 +0000 Subject: [PATCH] Rather than delaying datagrams if we've exceeded the throttle, just drop them. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6137 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/client/BlockingCommunicator.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/client/BlockingCommunicator.java b/src/java/com/threerings/presents/client/BlockingCommunicator.java index 7450b4627..f3b989a38 100644 --- a/src/java/com/threerings/presents/client/BlockingCommunicator.java +++ b/src/java/com/threerings/presents/client/BlockingCommunicator.java @@ -953,8 +953,13 @@ public class BlockingCommunicator extends Communicator return; } - // make sure we're not exceeding our outgoing throttle rate - throttleOutgoingMessage(); + // if we're exceeding our outgoing throttle rate, drop the packet + Throttle throttle = _client.getOutgoingMessageThrottle(); + synchronized(throttle) { + if (throttle.throttleOp()) { + return; + } + } try { // write the message out the socket