简体   繁体   中英

will http request timeout when server hold the connection for a long time?

when one http request send to the server(for example, java web server), and the server hold the request for a long time, don't send the response back, the timeout will happen or not?

I search for the http timeout, found the 408, and I don't think 408 is the timeout that I descirbed.

if timeout happen, can i set this timeout value? in the server or the client?

It will timeout if you've set a read timeout. If you haven't, it won't. A timeout becomes a SocketTimeoutException, not an HTTP error code. There is no HTTP error code. There is no HTTP response to get an error code from. That's why there is a timeout. You can set the timeout with URLConnection.setReadTimeout().

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM