| View previous topic :: View next topic |
| Author |
Message |
IrYoKu neophyte
Joined: 10 Apr 2005 Posts: 3
|
Posted: Mon Apr 11, 2005 2:38 pm Post subject: Number of sources problem when using the GUI protocol |
|
|
Hi,
I have developed a very simple client that displays current downloads in a superkaramba widget (a little application that lays in KDE desktop).
I show the number of sources for every download, and I am having troubles with that.
I am using the FileAddSource & FileRemoveSource messages to monitor the number of sources. Exactly, what I am doing is:
For every download set nSources = 0
Then, when receiving messages:
If a receive FileAddSource, then I increase nSources for that file.
If a receive FileRemoveSource, then I decrease nSources for that file.
The number of sources looks good at first (I compare it with the telnet interface output), but after a while the number of sources is less than it should, and after a looong time it ends up as a negative number.
I think that maybe I am missing something, so if someone can help me, I will appreciate it a lot. Some advices, things that I can check, etc.
Thanks,
IrYoKu |
|
| Back to top |
|
 |
su_blanc_ user

Joined: 16 Oct 2003 Posts: 51 Location: Fr
|
Posted: Tue Apr 12, 2005 5:34 am Post subject: |
|
|
Hi,
in the message opcode 52 FILE_INFO Core -> GUI, you have 2 fields file_active_sources (int) and file_all_sources (int).
If I were you, I would also use the message opcode 64 'InterestedInSources false' GUI -> Core (not to be flooded by the FileAddSource FileRemoveSource messages) when you have established the com with the Core.
To refresh the values you can use the message opcode 37 'GetFile_info (int)' GUI -> Core, from time to time.
Note that I never checked the accurracy of the values given by file_active_sources and file_all_sources.
hope that helps. |
|
| Back to top |
|
 |
IrYoKu neophyte
Joined: 10 Apr 2005 Posts: 3
|
Posted: Tue Apr 12, 2005 12:11 pm Post subject: |
|
|
Thanks for your reply
From protocol version 17 it seems that the file_active_sources & file_all_sources in the fileinfo message are always zeroed. A quote from g2gui protocol info:
| Quote: |
...
int32
Number of Sources (set to 0 by core, ie no info here)
int32
Number of Clients (set to 0 by core, ie no info here)
...
|
Also, I cannot use InterestedInSources because I think that in the version I use it is not supported, and a lot of gentoo users have the same version as me installed.
So it seems that I cannot use get_file_info to grab that information... |
|
| Back to top |
|
 |
IrYoKu neophyte
Joined: 10 Apr 2005 Posts: 3
|
Posted: Thu Apr 14, 2005 4:56 pm Post subject: |
|
|
I have upgraded mldonkey to last version (2.5.30-4), and the problem of sources is there too... I don't think it's a problem of my client code, because it's doing really trivial things and I have revised it hours and hours, so or it's a concept problem (maybe I don't have understood well the protocol, specially the add and remove sources messages) or is a core problem.
And now after upgrading to last version, I have other problem, the core is not sending the updateAvailability message (opcode 9) anymore. Why? I searched through the change log and found nothing about this.
Come on guys help me, I am really stuck  |
|
| Back to top |
|
 |
fabtar Sage

Joined: 04 Feb 2004 Posts: 1575 Location: Italy
|
Posted: Thu Apr 14, 2005 10:04 pm Post subject: |
|
|
| let''s try setting "good queue rank" to 6000, this settings helps a lot in my 2.5-16 ...only a try |
|
| Back to top |
|
 |
su_blanc_ user

Joined: 16 Oct 2003 Posts: 51 Location: Fr
|
Posted: Fri Apr 15, 2005 1:19 am Post subject: |
|
|
Hi,
| IrYoKu wrote: | | I have upgraded mldonkey to last version (2.5.30-4), and the problem of sources is there too... I don't think it's a problem of my client code, because it's doing really trivial things and I have revised it hours and hours, so or it's a concept problem (maybe I don't have understood well the protocol, specially the add and remove sources messages) or is a core problem. |
Do you send the the message opcode 64 'InterestedInSources true' when you opened the communication with the Core.
in src/daemon/driver/driverInterface.ml:
| Code: |
let send_event gui ev =
match ev with
....
| File_add_source_event (f,c) ->
if gui.gui_events.gui_interested_in_sources then
gui_send gui (P.File_add_source (file_num f, client_num c));
....
| File_remove_source_event (f,c) ->
if gui.gui_events.gui_interested_in_sources then
gui_send gui (P.File_remove_source (file_num f, client_num c));
....
|
| IrYoKu wrote: | | And now after upgrading to last version, I have other problem, the core is not sending the updateAvailability message (opcode 9) anymore. Why? I searched through the change log and found nothing about this. |
Look at the distrib/Todo.txt
| Code: | URGENT:
...
* Propagate client bitmaps to GUI
...
|
regards, |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © phpBB Group
|
|
|
|