libtorrent

Libtorrent Block Upload Alert


I need to embed billing into the libtorrent. So I need to know when node B successfully uploads a block to node A. But according to libtorrent docs, alert block-uploaded-alert is posted when a block intended to be sent to a peer is placed in the send buffer. So in fact the block is not yet uploaded when this alert is posted. Is there a way to know whether the upload was successful?

P.S. Can I limit the number of blocks which are uploaded to the same peer at the same time?


Solution

  • I'm dealing with a similar issue. From what i've discovered there's no implementation for this use case in libtorrent yet. The answer from arvid (the creator of Libtorrent) in this question: Get alerts for upload activity with libtorrent (rasterbar) may give us a hint about how to achieve this.

    Since i'm looking forward to implement this, i'm open to discuss about it and probably make a PR on libtorrent repo to achieve it: https://github.com/arvidn/libtorrent/issues/6247.