Hi,

I dare to say that my code is correct ;) The problem is that it is NEVER called - this condition (even if it's wrong, however it's not) is never checked. When I remove this line:

out.setWriteListener(new EchoWriteListener(queue, out));

it seems to work. However, I have no writer, so it should be rather called SwallowListener... It's not my goal.

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. https://java.net/projects/tyrus/sources/source-code-repository/content/trunk/containers/servlet/src/main/java/org/glassfish/tyrus/servlet/TyrusHttpUpgradeHandler.java

Thanks,
Przemyslaw


On Fri, Mar 28, 2014 at 5:14 PM, Heiko Braun <hbraun@redhat.com> wrote:
At a first glance, I'd say your while{} block never returns. Is ServletInputStream.isFinished() what you've been looking for, instead of isReady()

On 28 Mar 2014, at 16:26, PB <pbielicki@gmail.com> wrote:

while (in.isReady()) {