network object
This method will limit the incoming and outgoing bandwidth of the host.
bool set_bandwidth_limits(double incoming_bandwidth, double outgoing_bandwidth)
Parameters:
incoming_bandwidth
The number of incoming bytes to allow per second.
outgoing_bandwidth
The number of outgoing bytes to allow per second.
Return value:
true on success, false on failure.
Remarks:
BGT will continuously monitor the connection and try to detect bandwidth overflows dynamically, but this method gives fine control over exactly how much data that is sent and received to and from all peers every second. Setting the outgoing bandwidth to 4096, for instance, will cause BGT to stall delivery of reliable packets and strategically drop unreliable ones in order to try to prevent the outgoing bandwidth from ever exceeding 4 kb per second.
Setting either of these parameters to 0 will cause BGT to rely entirely upon its dynamic bandwidth throttling, which is the default behavior.
Example:
See the main network chapter.