<div dir="ltr"><div><div><div>Hi,<br><br></div>I dare to say that my code is correct ;) The problem is that it is NEVER called - this condition (even if it&#39;s wrong, however it&#39;s not) is never checked. When I remove this line:<br>
<br>out.setWriteListener(new EchoWriteListener(queue, out));<br><br></div><div>it seems to work. However, I have no writer, so it should be rather called SwallowListener... It&#39;s not my goal.<br><br></div><div>Maybe I should initialize WriteListener from the ReadListener after the first read? Or maybe, when I want to send back the response I should do this directly from the read listener? e.g. <a href="https://java.net/projects/tyrus/sources/source-code-repository/content/trunk/containers/servlet/src/main/java/org/glassfish/tyrus/servlet/TyrusHttpUpgradeHandler.java">https://java.net/projects/tyrus/sources/source-code-repository/content/trunk/containers/servlet/src/main/java/org/glassfish/tyrus/servlet/TyrusHttpUpgradeHandler.java</a><br>
<br></div><div>Thanks,<br></div><div>Przemyslaw<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 28, 2014 at 5:14 PM, Heiko Braun <span dir="ltr">&lt;<a href="mailto:hbraun@redhat.com" target="_blank">hbraun@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"><div style="word-wrap:break-word">At a first glance, I&#39;d say your while{} block never returns. Is ServletInputStream.isFinished() what you&#39;ve been looking for, instead of isReady()<div>
<br><div><div>On 28 Mar 2014, at 16:26, PB &lt;<a href="mailto:pbielicki@gmail.com" target="_blank">pbielicki@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><span style="font-family:&#39;courier new&#39;,monospace;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">while (in.isReady()) {</span></blockquote>
</div><br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<div>--</div><div><br></div><div><a href="http://about.me/hbraun" target="_blank">http://about.me/hbraun</a></div><div><br></div></div></span><br></div></span><br></div></span><br></div><br><br>
</div>
<br></div></div></blockquote></div><br></div>