Thinking about it more, what we really want is for the client to target the per

second rate (10 messages per second), and to do the same 10x buffer on the
server that we were doing before so that we avoid disconnects due to network
congestion (which might "save up" some throttled messages and then end up
delivering them in a bunch with some later messages).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5424 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-10-08 20:13:30 +00:00
parent 234b00df27
commit 2e8b63435a
5 changed files with 26 additions and 38 deletions
@@ -26,24 +26,19 @@ package com.threerings.presents.net;
*/
public class UpdateThrottleMessage extends DownstreamMessage
{
/** The number of messages allowed per throttle period. */
public final int messages;
/** The throttle period. */
public final long period;
/** The number of messages allowed per second. */
public final int messagesPerSec;
/**
* Zero argument constructor used when unserializing an instance.
*/
public UpdateThrottleMessage ()
{
this.messages = 0;
this.period = 0;
this.messagesPerSec = 0;
}
public UpdateThrottleMessage (int messages, long period)
public UpdateThrottleMessage (int messagesPerSec)
{
this.messages = messages;
this.period = period;
this.messagesPerSec = messagesPerSec;
}
}