can Client know how many handles a server can handle

I have a  program which will send some data HTTP.
when I start the program I initialize 5 handles and all the HTTP data I want to send I will do it on the 5 handles that are created.

the server (which is not in my control) is some times taking/accepting only 3 or 2 Handles.

Basically, I am looking for the solution with which I can know how many handles a server can handle so that I can distribute my load.

can I know how many http handles a server can accept?
vkchaitu82Asked:
Who is Participating?
 
Infinity08Connect With a Mentor Commented:
If you request something from a server that doesn't exist, you'll get a different error than when you request something from a server that has no free connections for you.

So, you can distinguish between the two if that's your problem.

Otherwise, I'm afraid I don't understand what it is you want done differently. If a server accepts only 3 incoming connections from you, then that's the amount you can use - no more.
0
 
Infinity08Commented:
>> can I know how many http handles a server can accept?

It depends on a few factors :

(a) how many total incoming connections the server can accept (often that's a (semi-) fixed limit)
(b) how many incoming connections the server allows per IP address (often that's a (semi-) fixed limit)
(c) what the current load of the server is (more load usually means less available connections)
(d) possibly other server specific configuration

Unless the server has an interface to report the (current) number of allowed connections for you (I've never seen that), it will be pretty much impossible to get this information. Due to the different factors (especially the load factor), it's inaccurate to perform a statistical analysis on how many you can obtain over time.

I wonder why you need to know though ... Why not take as many as you want and/or as many as you can ? When the limit is reached, you'll get a connection failed.


All of the above assumes that you're not in control of the server. If you are in control of the server, then you can obviously obtain (and modify) the configuration values mentioned above.
0
 
vkchaitu82Author Commented:
Thank you for the response.
Teh reason why Ia m looking f this information is my applications doing HTTP GETs to the server with the number of Handlers I provision. some times the queries are failing in internet. where I don't know the server.

At the same time I want to use Handler concept because I want to use the system efficiently :-)..

so looks we may not get a solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.