[undertow-dev] Setting/handling request timeouts

Bill O'Neil bill at dartalley.com
Tue Aug 19 14:12:53 EDT 2014


I have been having trouble figuring out how to set request timeouts and how
to handle them.

I have been messing around with the following.

Undertow server = Undertow.builder()
    .addHttpListener(8080, "localhost")
    .setSocketOption(UndertowOptions.IDLE_TIMEOUT, 1000)
    .setSocketOption(Options.READ_TIMEOUT, 1000)
    .setSocketOption(Options.WRITE_TIMEOUT, 1000)

When setting a HttpHandler that sleeps this will return an empty reply from
server.

curl -v localhost:8080
* Adding handle: conn: 0x7f81a900ee00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f81a900ee00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:8080
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server

1. What is the proper way to handle time outs?
2. Is it possible to set different timeouts per HttpHandler?

Thanks,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140819/99c72dd7/attachment.html 


More information about the undertow-dev mailing list