Fixed fundamental flaw with throttling code. Changed the client to adjust its message rate when it actually sends the throttle updated message. Otherwise the client starts sending at the new rate before the server knows about it. Keep the messages per second in the message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5499 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -26,5 +26,19 @@ package com.threerings.presents.net;
|
||||
*/
|
||||
public class ThrottleUpdatedMessage extends UpstreamMessage
|
||||
{
|
||||
// nothing needed
|
||||
/** The number of messages allowed per second. */
|
||||
public final int messagesPerSec;
|
||||
|
||||
/**
|
||||
* Zero argument constructor used when unserializing an instance.
|
||||
*/
|
||||
public ThrottleUpdatedMessage ()
|
||||
{
|
||||
this.messagesPerSec = 0;
|
||||
}
|
||||
|
||||
public ThrottleUpdatedMessage (int messagesPerSec)
|
||||
{
|
||||
this.messagesPerSec = messagesPerSec;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user