<div dir="ltr"><div>Thanks for the reply Stuart, I've made the modifications I mentioned to the WebSockets class in my project by creating a copy of it and it's working great.</div><div>I'm wondering if it would be possible to have the PooledByteBuffer versions added into official undertow source.</div><div><br></div><div>Here'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"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></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>
<<a href="mailto:mario.e.carbajal@gmail.com">mario.e.carbajal@gmail.com</a>> wrote:<br>
> From looking at the source it seems that the WebSockets.sendBinary methods<br>
> that take ByteBuffer will take ownership of the buffer, meaning I shouldn't<br>
> modify (or return it to a pool) after I pass it to these methods. Is this<br>
> 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>
><br>
> Looking at sendInternal, the buffer passed is then wrapped in a dummy<br>
> ImmediatePooledByteBuffer. I could make alternative versions of these<br>
> sendBinary methods that take PooledByteBuffer. Allowing me to use pooled<br>
> buffers.<br>
<br>
</span>Sounds good.<br>
<span class=""><br>
><br>
> Since this functionality is missing it makes me think that there may be a<br>
> reason why it shouldn't be done.<br>
<br>
</span>Mostly because nobody has asked for it yet.<br>
<br>
Stuart<br>
<br>
><br>
> ______________________________<wbr>_________________<br>
> undertow-dev mailing list<br>
> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> <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>