mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mldonkey-users] update_gui_info()


From: MLdonkey
Subject: Re: [Mldonkey-users] update_gui_info()
Date: Wed, 5 Feb 2003 07:58:24 +0100

>  The GUI has bandwidth information in the bottom right corner of the status 
> line.  TCP/UDP real time bandwidth statistics.
>  
>  I would like to know the best way to get this information into the non-gui 
> interface (ie: a command like "bw_stats" in driverCommands.ml?)
>  
>  In driver/driverInterface.ml the update_gui_info() function seems
>  to be the only place this information is available, and I can't
>  access it very easy.  Does anyone have any pointers on the right
>  way to access this information from driverCommands.ml without a lot
>  of repetitious code (my OCaml is still very basic)?  Thank you.

Create variables in DriverInteractive.ml for the info you want:

let saved_upload_rate = ref 0    (* ref means that you want to be able
                                    to change the variable value *)
...

In update_gui_info, which is called every second, store the results
you  want in your variables:

before "let msg = (Client_stats {...", you can put:

saved_upload_rate := control_upload_rate; (* := changes a 'ref' type variable 
value *)

In your "bw_stats", just use the "saved_..." variables that are
updated every second...

BTW, your n2 patch has been applied, and will be commited soon.

Thanks a lot for your contributions,

- MLDonkey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]