<div dir="ltr">I have been having trouble figuring out how to set request timeouts and how to handle them.<div><br></div><div>I have been messing around with the following.</div><div><br></div><div><div>Undertow server = Undertow.builder()</div>
<div>    .addHttpListener(8080, &quot;localhost&quot;)</div><div>    .setSocketOption(UndertowOptions.IDLE_TIMEOUT, 1000)</div><div>    .setSocketOption(Options.READ_TIMEOUT, 1000)</div><div>    .setSocketOption(Options.WRITE_TIMEOUT, 1000)</div>
</div><div><br></div><div>When setting a HttpHandler that sleeps this will return an empty reply from server.</div><div><br></div><div><div>curl -v localhost:8080</div><div>* Adding handle: conn: 0x7f81a900ee00</div><div>
* Adding handle: send: 0</div><div>* Adding handle: recv: 0</div><div>* Curl_addHandleToPipeline: length: 1</div><div>* - Conn 0 (0x7f81a900ee00) send_pipe: 1, recv_pipe: 0</div><div>* About to connect() to localhost port 8080 (#0)</div>
<div>*   Trying ::1...</div><div>*   Trying 127.0.0.1...</div><div>* Connected to localhost (127.0.0.1) port 8080 (#0)</div><div>&gt; GET / HTTP/1.1</div><div>&gt; User-Agent: curl/7.30.0</div><div>&gt; Host: localhost:8080</div>
<div>&gt; Accept: */*</div><div>&gt;</div><div>* Empty reply from server</div><div>* Connection #0 to host localhost left intact</div><div>curl: (52) Empty reply from server</div></div><div><br></div><div>1. What is the proper way to handle time outs?</div>
<div>2. Is it possible to set different timeouts per HttpHandler?</div><div><br></div><div>Thanks,</div><div>Bill</div></div>