[Box Backup-dev] question about the config file
Ben Summers
boxbackup-dev at fluffy.co.uk
Mon Jul 24 18:33:27 BST 2006
Oh, I see.
What I had imagined was template class StreamThrottled<typename
Base>, possibly in lib/server rather than lib/common. This has an
additional SetThrottle(int BytesPerSecond) method which sets the
bandwidth it should use. Write() is overloaded, and keeps track of
how many bytes to send, and nanosleeps if necessary.
Add a config option in BackupClientConfigVerify.cpp. If the option is
present, then BackupClientContext::GetConnection creates a throttled
object, StreamThrottled<SocketStreamTLS>, instead of the normal
object. It can get at the config file via mrDaemon.GetConfiguration().
I think putting the throttling into the Socket classes is just messy.
Ben
On 24 Jul 2006, at 18:21, Nick Knight wrote:
> Kind of a mix, I can see daemon class loads the config file, but I
> want
> to add a parameter for bandwidth throttling, which the socket classes
> get, I would if this is ok have it put into the source tree again, so
> wanted to know how you like the parameters passed form the config
> to the
> classes, are you ok with classes daemon and hence the config file,
> or do
> you want parameters being passed down as they are created - or
> other....
>
> If you are not fussed then I will try what looks the most elegant
> to me.
>
> Nick
>
> -----Original Message-----
> From: boxbackup-dev-admin at fluffy.co.uk
> [mailto:boxbackup-dev-admin at fluffy.co.uk] On Behalf Of Ben Summers
> Sent: 24 July 2006 14:54
> To: boxbackup-dev at fluffy.co.uk
> Subject: Re: [Box Backup-dev] question about the config file
>
>
> Do you really mean a coding standard (which I'm not sure why it's
> relevant), or are you asking how to do it?
>
> Ben
>
>
> On 24 Jul 2006, at 14:09, Nick Knight wrote:
>
>> Hello All,
>>
>>
>>
>> Is there a coding standard if I want to add a parameter to the
>> config file, then have a class down the line use that parameter?
>>
>>
>>
>> Regards
>>
>>
>>
>> Nick
>>
>>
>
> _______________________________________________
> Boxbackup-dev mailing list
> Boxbackup-dev at fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev
> _______________________________________________
> Boxbackup-dev mailing list
> Boxbackup-dev at fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup-dev
More information about the Boxbackup-dev
mailing list