Re: [asio-users] querying for active async operations
Brought to you by:
chris_kohlhoff
From: Arvid N. <c9...@cs...> - 2005-12-15 23:24:14
|
On Dec 15, 2005, at 13:21, Christopher Kohlhoff wrote: > Hi Arvid, > > Sorry for the delayed reply on this one. I'm spending a lot of time > reading and answering emails at the moment ;) > > --- Arvid Norberg <c9...@cs...> wrote: >> I have a stream_socket, and I want to throttle the bandwidth >> it uses for the data I send and receive on that socket. Right >> now I have implemented this as a per second quota. When the >> socket runs out of quota it won't receive anything until the >> next second, when it's restored again. > <snip> >> And, btw, is this a stupid way of throttling the download >> speed? (assuming there's no protocol support that can tell >> the other side to throttle its send rate). > > How about this for an idea, although not sure if it fits your > use case exactly: develop a stream template (similar to > ssl::stream or buffered_stream) that embargoes data until the > quota would not be exceeded. Thanks! That's a very nice solution. > For example: > [...] -- Arvid Norberg |