State Maintainer: GlobalNetworkByteCount

stateblock GlobalNetworkByteCount augments RNetwork {
  addstate RNetwork.gBytesSent: int = 0;
  addstate RNetwork.gBytesReceived: int = 0;

  precode postSend (remote: RNetAddress, nbytes: int) {
      gBytesSent += nbytes; 
  }

  precode postReceive (remote: RNetAddress, nbytes: int) {
      gBytesReceived += nbytes; 
  }
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science