Yeah, I didn't spend a lot of time on it. I tried a couple of approaches before throwing up my hands and going with a crude, "brute force" sort of approach. I'm not a big fan of the magic numbers for the sleep start point and adjustment values either.

Only throttling the PIECE messages kind of muddied the water, but I didn't want to throttle the entire protocol.

I'd like to revisit it when I have a little more time.