<div dir="ltr"><div>I actually figured that out, Stuart, thanks. So I have writing a ByteBuffer covered. Any thoughts on handling the ReadableByteChannel?  Looking at the Jetty impl, it appears I need to read it into one or more ByteBuffers and then write them out. Should I use the Pooled&lt;ByteBuffer&gt; from the exhange&#39;s connection? <br><br></div>Jim<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 6:00 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=""><br>
<br>
Jim Crossley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
I&#39;m looking to promote Undertow as a preferred alternative to Jetty for<br>
the Pedestal [1] framework.<br>
<br>
One Jetty feature it relies on is the async sending of ByteBuffers and<br>
ReadableByteChannels in Jetty&#39;s impl of ServletOutputStream [2]. Two<br>
methods, in particular: sendContent(ByteBuffer, Callback) and<br>
sendContent(<u></u>ReadableByteChannel, Callback).<br>
</blockquote>
<br></span>
If you have enabled async mode on the ServletOutputStream then write(ByteBuffer) will write using async IO, and invoke the write listener when done. Basically it will work the same as standard servlet async IO, but with byte buffers.<br>
<br>
Stuart<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
I was hoping someone might point me in the right direction of<br>
replicating this behavior with Undertow&#39;s ServletOutputStreamImpl. It<br>
does have a write(ByteBuffer) method, but it appears to be blocking. And<br>
I was hoping there might be some XNIO abstraction for dealing with the<br>
ReadableByteChannel, perhaps some example code somewhere?<br>
<br>
Any and all help/advice is appreciated!<br>
Jim<br>
<br>
[1]: <a href="https://github.com/pedestal/pedestal" target="_blank">https://github.com/pedestal/<u></u>pedestal</a><br>
[2]:<br>
<a href="http://grepcode.com/file/repo1.maven.org/maven2/org.eclipse.jetty/jetty-server/9.2.0.v20140526/org/eclipse/jetty/server/HttpOutput.java" target="_blank">http://grepcode.com/file/<u></u>repo1.maven.org/maven2/org.<u></u>eclipse.jetty/jetty-server/9.<u></u>2.0.v20140526/org/eclipse/<u></u>jetty/server/HttpOutput.java</a><br>
<br></span>
______________________________<u></u>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/undertow-dev</a><br>
</blockquote>
</blockquote></div><br></div>