stateblock SoftSendCounter augments RNetwork {
requires TrackSendRate;
addstate RNetwork.sendLimit: int; // make this a param
// Returns the number of bytes that can be sent this quantum
helper quantumSendAvailable () returns int {
updateTimer ();
if (bytesSent >= sendLimit) {
// Wait for a new quantum before returning
waitForQuantum ();
}
return (sendLimit - bytesSent);
}
}
Naccio Home Page
University of Virginia, Computer Science