http://www.xantorrent.pwp.blueyonder.co.uk/ics/ThrottledWSocket.zip has some example throttling code. Only uses one timer and throttles all your connections to one limit. No sleeping involved.
Dan ----- Original Message ----- From: "Fastream Technologies" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Saturday, January 14, 2006 7:47 PM Subject: [twsocket] Throttling for THttpConnection > Hello, > > When I run 32 THttpConnection's in a single worker thread, I cannot use > the > throttling with the Sleep() command like in one-thread/connection design > as > the sleep call blocks the other connections as well since they are in the > same thread context. I know that there is a limitation for number of > timers > per process so here is what I tried: > > - created one timer per thread > - paused connections in Sleep place > - resumed them after the calculated ms in timer > > BUT > > - since the timer runs every 20-50 ms (both does the same result), the > sleep > period cannot be less than that! I get inconsistent speed results (for > example, for a 100kBps, I get a fluctuating value between 89-102kBps). > Does > anybody know a good solution for this problem? > > Best Regards, > > SZ > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be