<div dir="ltr">So there are a few options, but if you actually want to generate a HTTP response instead of just dropping the connection then your application code is going to have to take some responsibility.<div><br></div><div>If all you want to do is drop the connection then just scheduling a task that does exchange.getConnection().close() is fine, no HTTP response will be returned to the client.</div><div><br></div><div>If you want to actually send a response to the client then you are going to have to have some kind of lock/CAS that prevents your application from writing once the timeout has taken effect. </div><div><br></div><div>Are you using the Servlet API or the HttpServerExchange API? The best way to approach this is a bit different depending on what you are doing.</div><div><br></div><div>Stuart</div><div><br></div><div><br></div><div><br><div><div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 15, 2018 at 11:50 AM Stan Rosenberg <<a href="mailto:stan.rosenberg@acm.org">stan.rosenberg@acm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Apologies if this question has already been answered elsewhere; closest I could find is this thread: <a href="http://lists.jboss.org/pipermail/undertow-dev/2014-August/000898.html" target="_blank">http://lists.jboss.org/pipermail/undertow-dev/2014-August/000898.html</a><div><br></div><div>HttpServerExchange cannot be manipulated from multiple threads (without locking). Thus, dispatch and executeAfter wouldn't work if the goal is to end the exchange after the max. time to process (request) has been exceeded.</div><div><br></div><div>I can implement this timeout mechanism using out-of-band thread executor but was hoping there is a more efficient way provided by the framework. Thanks.</div><div><br></div><div>Best,</div><div><br></div><div>stan</div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a></blockquote></div></div></div></div></div>