github.com/arvidn/libtorrent/issues/new?title=docs:peer_plugin%3A%3A%5Bon_piece%28%29%5D&labels=documentation&body=Documentation+under+heading+%22peer_plugin%3A%3A%5Bon_piece%28%29%5D%22+could+be+improved">report issue</a>]</span></div>
<div class="section" id="on-piece">
<h2>on_piece()</h2>
<pre class="literal-block">
virtual bool <strong>on_piece</strong> (peer_request const&amp; <em>/*piece*/</em>
      , span&lt;char const&gt; <em>/*buf*/</em>);
</pre>
<p>This function is called when the peer connection