Emulate/simulate a traffic shaper who transmits packets controlled by a token bucket filter using multi-threading within a single process.