<div dir="ltr">Thanks for explaining the option with getRequestChannel! Got it working by reading content into a pre-allocated ByteBuffer.<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style="font-family:arial,sans-serif;font-size:13px">if it returns 0 register a read listener and call resumeReads()</span></blockquote><div><br></div><div>One thing I don&#39;t fully understand though is your note about registering a read listener (+ calling resumeReads) and why this is needed. Is it a mandatory step, and if it is, are you referring to application-specific read listener or Undertow&#39;s io.undertow.server.protocol.http.HttpReadListener? I guess this is pretty basic question, so it would be great if you can just point me to the right place at documentation, so that I can figure it out.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:13px">Thinking about it we probably just need some way to buffer a complete/partial message and then invoke a callback with the data.</span></blockquote>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Yep, I guess this would be easier for the app developer to use.</span></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 2:34 AM, 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">You can use the getRequestChannel() method to get the request channel. Basically call read() on the channel till it returns either 0 or -1, if it returns -1 you are done, if it returns 0 register a read listener and call resumeReads().<br>

<br>
I have always been meaning to add a nicer non-blocking API for this, but I have never been exactly sure what would be required here. Thinking about it we probably just need some way to buffer a complete/partial message and then invoke a callback with the data.<br>

<br>
Stuart<br>
<br>
Vladimir Tsukur wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
One of the ways to obtain request entity is to call<br>
HttpServerExchange.<u></u>startBlocking and then read content from the<br>
HttpServerExchange.<u></u>getInputStream.<br>
<br>
Is there a way to obtain request entity in a non-blocking way?<br>
<br>
--<br>
Vladimir Tsukur<br>
Software Architect, Design Engineer and Scrum Master<br>
<br></div></div>
______________________________<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><br clear="all"><div><br></div>-- <br>Vladimir Tsukur<br>Software Architect, Design Engineer and Scrum Master
</div>