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.
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.
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.
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.
Stuart
On Sun, Jul 15, 2018 at 11:50 AM Stan Rosenberg <stan.rosenberg(a)acm.org>
wrote:
Apologies if this question has already been answered elsewhere;
closest I
could find is this thread:
http://lists.jboss.org/pipermail/undertow-dev/2014-August/000898.html
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.
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.
Best,
stan
_______________________________________________
undertow-dev mailing list
undertow-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev