I am trying to get alerts for the data that I'm sending peers.  My code works great for incoming blocks by looking for libtorrent.block_finished_alert but I want to know when and what I am sending to peers.  I can't find an alert that will give me the equivalent for outbound transfers.  I need to know the file and offset (the peer request).
Is there an alert for outbound block requests?
I'm using the python bindings but C++ code is fine too.
The closest thing you have to alerts is probably stats_alert. It will tell you the number of payload bytes uploaded. It won't give the you granularity of a full block being sent though.
If you'd like to add an alert, have a look at bt_peer_connection::write_piece.
patches are welcome!
Get alerts for upload activity with libtorrent (rasterbar)