Unanswered Determining concurrent connections

  • Tuesday, October 25, 2011 7:14 PM
     
     
    I have an app that launches serveral copies of itself on remote machines and opens a share to some central location to copy files. I would like to limit the number of connections this app creates by determining ahead of time how many connections the central machine can take. Is there an API to do that?

All Replies

  • Wednesday, October 26, 2011 4:01 AM
     
     

    What is the purpose of this application? It has virus written all over it.

     

    If I was the target of such as application, I'd go to great lengths to have the author fired.

  • Wednesday, October 26, 2011 2:08 PM
     
     
    It's purpose is to audit machines listed in a database for a wide variety of information and log that information and copy files to a central location. I'm not sure why this sounds like a virus as it doesn't actually alter the machines it audits in any way other than to create a share to a central machine, using NetShareAdd(), which when complete deletes with NetShareDel(). Everything it does requires it to be run as an administrator with (authorized) access to all the systems involved. I would hope I wouldn't be fired for this as it was the task I was hired for and I'm being paid a fair amount of money to do it. Now, do you have a suggestion for me on how to determine the connection limit for the central machine?
  • Wednesday, October 26, 2011 3:27 PM
     
     

    What kind of connection are you talking about? A TCP connection? If so, you are talking about tens of thousands of connections.

    You should of course be leveraging Windows Management Instrumentation for this project. I hope you haven't overlooked this technology.

  • Wednesday, October 26, 2011 4:28 PM
     
     
    What kind of connection are you talking about? A TCP connection? If so, you are talking about tens of thousands of connections.

    I'm referring to the connection made using NetShareAdd() so I'm guessing this would be considered a TCP connection. Now I understand through research that the limit for this type of connection is not enforced (through licensing) but there is still a limit. If I don't need to worry about connections being refused at some arbitrary limit then I have no problem. If I do need to worry then I need to know what that limit is. I will have the option for the user to throttle the number of connections made but I would like to have an upper limit imposed if possible.
    You should of course be leveraging Windows Management Instrumentation for this project. I hope you haven't overlooked this technology.
    Not overlooked. Dismissed. Unless I'm wrong (which I frequently am), WMI for remote users must be enabled on the machine. Since the central repository machine can change from run to run and can be any one of literally thousands of machines, enabling WMI on every one of them is not feasible.
    Thanks, I appreciate your insights,
    Drew
  • Wednesday, October 26, 2011 7:28 PM
     
     
    OK. It would seem that the limit is based on SMB concurrent connections and not TCP connections. In which case my original question still stands. Is there a way to determine this limitation programmatically (w/o WMI)?
    • Edited by D A M Wednesday, October 26, 2011 7:29 PM
    •  
  • Thursday, October 27, 2011 4:33 AM
     
     

    Not overlooked. Dismissed. Unless I'm wrong (which I frequently am), WMI for remote users must be enabled on the machine. Since the central repository machine can change from run to run and can be any one of literally thousands of machines, enabling WMI on every one of them is not feasible.

    I fail to see why you feel compelled to use NetShareAdd() as your solution. Why don't you simply use the power of Group Policy to add a common network share via the Domain Controller? Aren't the computers all part of a domain or forest? Similarly, using the Domain Controller, you can enable WMI on every computer within the domain or forest if you wish.

    My sense is that you are reaching into the toolbox and pulling out the wrong tool.

  • Thursday, October 27, 2011 2:36 PM
     
     

    I fail to see why you feel compelled to use NetShareAdd() as your solution. Why don't you simply use the power of Group Policy to add a common network share via the Domain Controller? Aren't the computers all part of a domain or forest? Similarly, using the Domain Controller, you can enable WMI on every computer within the domain or forest if you wish.

     

    It would be nice to have that sort of control over the ultimate end user, but alas, I don't. While it's true that the machines will all be part of a domain, I don't have the power to dictate that shares be added by some administrator or that they enable WMI on all of their machines. The list of machines that the software will run on is configured, potentially from run to run, by the ultimate end user. To have them open up WMI on an ever changing list of machines is not feasible. I assume there is some risk for enabling it as it is not enabled by default (anymore). Also, it seems unlikely that I would be able to convince them to create a permanent share on a machine that may also be different from run to run.

    I appreciate all of your suggestions and would like it if I could follow them but the constraints of the project restrict me from doing so. The program must run as unobtrusively as possible and with as little intervention or configuration as it can. It will be distibuted with a company's application to their customers for support of their software so it is meant to be a support tool rather than a full blown application that the end user would be expected to "learn".

    Any ideas about a non-technical solution would also be welcome. For instance how many SMB connections are supported by OS. I have found many conflicting answers to rhis question other than XP supports 10. How about server versions or Vista/Win7. I've seen 20 for Vista/Win7 but I've also seen 10 for the case of upgrades. If I had this info I may be able to come up with a way to query the OS version remotely and go from there. Not as reliable but I'm running out of ideas.

    Thanks again, Brian, for your attention.

    Best regards, Drew