property NetHardSendBandwidthLimit(bLimit: int, tLimit: int) {
// Limit network bandwidth useage to nbytes every timeStep (in milliseconds)
// Hard limit means that an error is reported whenever the limit is
// exceeded.
requires NetworkSendBandwidthCounter;
postcode RNetwork.initialize () {
sendTimeSlice = tLimit;
sendByteLimit = bLimit;
sendBytesLeft = bLimit;
}
check RNetwork.preSend (remote: RNetAddress, nbytes: int) {
NetHardBandwidthLimitCheck (nbytes, sendBytesLeft, sendByteLimit,
sendTimeSlice, "send");
}
}
Naccio Home Page
University of Virginia, Computer Science