Sam YC
Sam YC

Reputation: 11617

Java Proxy Connections through multiple thread

I have few questions as below:

1) I have a Java program which tryning to connect through different Proxy Servers by using multiple thread (about 100 threads). May I know that what factors determine the maximum number of such connections? What actually is the maximum number of proxy connection (or non-proxy) that our OS allowed to have in one process?

2) According to my experience, when I want to set the proxy server in my pc, I will to IE's "options settings" to change it. When I am using Google Chrome, the proxy settings will go through the IE's "options settings" as well (I don't know why chrome uses IE's function). So, can I assume that our OS only allow one proxy server connection at one time?

Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(ipAdd, portNum));
HttpURLConnection uc = (HttpURLConnection)Main.targetMachine.openConnection(proxy);
uc.setConnectTimeout(Main.timeOut);
uc.setReadTimeout(Main.timeOut);

I create multiple thread to handle the connections as above. They gave me all the "timeout" error. What could be the reasons?

Upvotes: 1

Views: 847

Answers (1)

anonymous proxy
anonymous proxy

Reputation: 46

because the server is configured only responds only for a few connected threads from a particular node hence if multiple connection are made then the above error appears just find the optimal number of connection and set it

Upvotes: 3

Related Questions