can Client know how many handles a  server can handle

Posted on 2009-12-18
Last Modified: 2013-11-21
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?
Question by:vkchaitu82
    LVL 53

    Expert Comment

    >> 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.

    Author Comment

    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
    LVL 53

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
    Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
    The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now