开发者

Java: Do jvm global timeouts work via proxy?

I set 2 global networking timeouts:

System.开发者_如何学运维setProperty("sun.net.client.defaultConnectTimeout", "2000");
System.setProperty("sun.net.client.defaultReadTimeout", "3000");

It works fine when in case of direct connections. But if proxy is set for the JVM, connections are kept in waiting state few minutes.

Proxy is alo set via JVM params:

http.proxyHost=some_host 
http.proxyPort=8080

Why connections are not interrupted by timeout if proxy is involved? In general what network configuration can prevent http connection/read timeouts to act properly?


They work between the JVM and the proxy. By its nature the proxy should be reflecting what it is or isn't receiving from the server almost instantaneously, although people do have strange ideas about how to implement homegrown proxies. But the JVM timeouts don't actually take effect at the proxy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜