문제

How can I modify the read timeout for embedded tomcat?
From Apache Tomcat Configuration Reference:

socket.soTimeout
Value in milliseconds for the sockets read timeout (SO_TIMEOUT). Default value is 5000 milliseconds.

I've tried the following

    httpConnector.setAttribute("channelNioSocket.soTimeout", 1);
    httpConnector.setAttribute("soTimeout", 1);
    httpConnector.setAttribute("SO_TIMEOUT", 1);

I expected to get SocketTimeoutException as I changed the value to 1 millisecond, but didn't, so I assume it's not working.

도움이 되었습니까?

해결책

Found it!

org.apache.catalina.connector.Connector#setProperty

For example:

httpConnector.setProperty("soTimeout", "50000");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top