<div dir="ltr"><div>Ok, thanks, here&#39;s the JIRA with a failing test attached as a patch:<br></div><div><br></div><a href="https://issues.jboss.org/browse/UNDERTOW-589">https://issues.jboss.org/browse/UNDERTOW-589</a><br><div class="gmail_extra"><br></div><div class="gmail_extra">Nel</div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-23 7:46 GMT+01:00 Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This sounds like a bug, can you file a JIRA?<br>
<br>
<a href="https://issues.jboss.org/projects/UNDERTOW" rel="noreferrer" target="_blank">https://issues.jboss.org/projects/UNDERTOW</a><br>
<br>
Stuart<br>
<div><div class="h5"><br>
----- Original Message -----<br>
&gt; From: &quot;Nel Taurisson&quot; &lt;<a href="mailto:nel.taurisson@gmail.com">nel.taurisson@gmail.com</a>&gt;<br>
&gt; To: <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
&gt; Sent: Monday, 23 November, 2015 5:00:10 PM<br>
&gt; Subject: [undertow-dev] SSE close task<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m playing with the SSE handler and I can&#39;t figure how the close task is<br>
&gt; working. I thought the close task would be invoked when the client closes<br>
&gt; the connection but it doesn&#39;t seem to be the case.<br>
&gt;<br>
&gt; I slightly modified the example code to register a close task when a<br>
&gt; connection is initiated, here&#39;s the code :<br>
&gt;<br>
&gt; ServerSentEventConnectionCallback callback = new<br>
&gt; ServerSentEventConnectionCallback() {<br>
&gt; @Override<br>
&gt; public void connected(ServerSentEventConnection connection, String<br>
&gt; lastEventId) {<br>
&gt; System.out.println(&quot;adding close task on connection...&quot;);<br>
&gt; connection.addCloseTask(channel -&gt; System.out.println(&quot;goodbye cruel<br>
&gt; world...&quot;));<br>
&gt; }<br>
&gt; };<br>
&gt; final ServerSentEventHandler sseHandler =<br>
&gt; Handlers.serverSentEvents(callback);<br>
&gt;<br>
&gt; It appears to me that the close task is only invoked when the server stops,<br>
&gt; but now when the client closes. Is it the expected behavior ? If so, is<br>
&gt; there any other way to be notified of a client disconnection ?<br>
&gt;<br>
&gt; Thanks a lot.<br>
&gt;<br>
&gt; Nel<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div></div>