<div dir="ltr"><div>Thanks for the reply Stuart, I&#39;ve made the modifications I mentioned to the WebSockets class in my project by creating a copy of it and it&#39;s working great.</div><div>I&#39;m wondering if it would be possible to have the PooledByteBuffer versions added into official undertow source.</div><div><br></div><div>Here&#39;s a gist of how it looks like:</div><a href="https://gist.github.com/anonymous/cbb6004adb1a30d4274622814a69284c">https://gist.github.com/anonymous/cbb6004adb1a30d4274622814a69284c</a><br><div><br></div><div>if it makes sense I can make a fork and pull request, also add PooledByteBuffer versions for all the send methods.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 8:36 PM, Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jan 27, 2017 at 6:50 AM, Mario Carbajal<br>
&lt;<a href="mailto:mario.e.carbajal@gmail.com">mario.e.carbajal@gmail.com</a>&gt; wrote:<br>
&gt; From looking at the source it seems that the WebSockets.sendBinary methods<br>
&gt; that take ByteBuffer will take ownership of the buffer, meaning I shouldn&#39;t<br>
&gt; modify (or return it to a pool) after I pass it to these methods. Is this<br>
&gt; correct?<br>
<br>
</span>Yes, you need to wait for the callback to be called before you can do<br>
anything with it.<br>
<span class=""><br>
&gt;<br>
&gt; Looking at sendInternal, the buffer passed is then wrapped in a dummy<br>
&gt; ImmediatePooledByteBuffer. I could make alternative versions of these<br>
&gt; sendBinary methods that take PooledByteBuffer. Allowing me to use pooled<br>
&gt; buffers.<br>
<br>
</span>Sounds good.<br>
<span class=""><br>
&gt;<br>
&gt; Since this functionality is missing it makes me think that there may be a<br>
&gt; reason why it shouldn&#39;t be done.<br>
<br>
</span>Mostly because nobody has asked for it yet.<br>
<br>
Stuart<br>
<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>