This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Troubles during development of extension for ZeroConf Plugin

Tags: None
(comma "," separated)
imported4-nico
Registered Member
Posts
3
Karma
0
Hi all,
I'm experimenting to extend the functionality of the ZeroConf Plugin and I encountered some inexplicable errors:
1) torrentInterface->getStats().torrent_name returns sometimes the real torrent name concatenated with the character 'X'. Very weird, can someone explain me what has happened and who has appended that character? It's a mystery for me :)

2) I've found following definition of choked on this forum:
choked
When a connection is choked, it means that the transmitter isn't currently sending anything else on the link. A BitTorrent Client signals that it's choked to other clients for a number of reasons, the most common is that by default a client will only maintain --max_uploads active simultaneous uploads, the rest will be marked choked. A connection can also be choked for other reasons, for example a peer downloading from a seed will mark his connection as choked since the seed has no need to receive.


I was expermenting to download chunks from a local peer (discovered by ZeroConf!!!) and it did not work if the choked flag was set for this peer source. Can someone explain me why sometimes the choke flag is set for my local peer (and downloading from this peer will fail!) and sometimes not?
imported4-nico
Registered Member
Posts
3
Karma
0

Thu Apr 09, 2009 11:48 pm
And I want to use a custom ChunkSelector.
The only way I see to realize that my own chunk selector in my plugin will be called, is by using the TorrentControl method:
Code: Select all
/// Set a custom chunk selector factory (needs to be done for init is called)
      void setChunkSelectorFactory(ChunkSelectorFactoryInterface* csfi);


But this is not working right now because the default chunk selector is already set. Is it possible to replace the default chunk selector?

Thanks!
George
Moderator
Posts
5421
Karma
1
nico wrote:Hi all,
I'm experimenting to extend the functionality of the ZeroConf Plugin and I encountered some inexplicable errors:
1) torrentInterface->getStats().torrent_name returns sometimes the real torrent name concatenated with the character 'X'. Very weird, can someone explain me what has happened and who has appended that character? It's a mystery for me :)


That shouldn't happen. No X is added. Maybe a non 0 terminated character array problem ?

2) I've found following definition of choked on this forum:

I was expermenting to download chunks from a local peer (discovered by ZeroConf!!!) and it did not work if the choked flag was set for this peer source. Can someone explain me why sometimes the choke flag is set for my local peer (and downloading from this peer will fail!) and sometimes not?


If the choked flag is on, the peer will not upload to you. The number of upload slots is limited, and a peer will only send unchoke packets to peers it gives an upload slot to. Every 30 seconds a peer will determine which are the best peers to upload to and it will send those an unchoke. To discover new better peers, it will also unchoke a random one.
George
Moderator
Posts
5421
Karma
1

Fri Apr 10, 2009 7:16 am
nico wrote:And I want to use a custom ChunkSelector.
The only way I see to realize that my own chunk selector in my plugin will be called, is by using the TorrentControl method:
Code: Select all
/// Set a custom chunk selector factory (needs to be done for init is called)
      void setChunkSelectorFactory(ChunkSelectorFactoryInterface* csfi);


But this is not working right now because the default chunk selector is already set. Is it possible to replace the default chunk selector?

Thanks!


This was added for the KGet people, who manage the TorrentControl objects in the KGet bittorrent plugin. So they can have their own ChunkSelector.

So at the moment this is not possible.

Why do you need a custom ChunkSelector ?
imported4-nico
Registered Member
Posts
3
Karma
0

Fri Apr 10, 2009 10:11 am
Thanks for the reply!

Why do you need a custom ChunkSelector ?

I want to use a custom chunk selector for managing which chunks the client must download and which certainly not. I want a smooth collaboration between local peers to download a torrent file. When 2 or more local peers discover that they both downloading the same torrent file, they must each download a disjunct part of the torrent and afterwards they must exhange the chunks on the local network (which is mush faster). At the end all local peers will have the complete torrent file.
The main purpose to implement a custom ChunkSelector is that every
chunk is downloaded from the internet only once.

Maybe there is another way to achieve this?
George
Moderator
Posts
5421
Karma
1

Mon Apr 13, 2009 11:12 am
nico wrote:Thanks for the reply!

Why do you need a custom ChunkSelector ?

I want to use a custom chunk selector for managing which chunks the client must download and which certainly not. I want a smooth collaboration between local peers to download a torrent file. When 2 or more local peers discover that they both downloading the same torrent file, they must each download a disjunct part of the torrent and afterwards they must exhange the chunks on the local network (which is mush faster). At the end all local peers will have the complete torrent file.
The main purpose to implement a custom ChunkSelector is that every
chunk is downloaded from the internet only once.

Maybe there is another way to achieve this?


The trouble is that the ChunkSelector is created before the plugins are loaded.

You will need to add a method to TorrentControl to replace the default ChunkSelector.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft