Detecting whether the C-Gate server is running?

Discussion in 'C-Bus Toolkit and C-Gate Software' started by BeoLinker, Aug 4, 2004.

  1. BeoLinker

    BeoLinker

    Joined:
    Aug 3, 2004
    Messages:
    58
    Likes Received:
    0
    Location:
    Wigan, UK
    Hi all,

    I am trying to detect whether the C-Gate.jar server is running on the PC in order to control it myself.

    I have tried to detect it as a running service in the OS although I can only see the Java interpreter as the C-Gate.jar service does not seems to manifest itself in the OS. Given other apps potentially use the interpreter this is not a failsafe way of detection.

    Not being a Java expert I was wondering if there are any parameters you can pass to it to get some feedback to the state of an application

    i.e. javaw c-gate.jar /status would be nice!

    Thanks
    Greg...
     
    BeoLinker, Aug 4, 2004
    #1
  2. BeoLinker

    Duncan

    Joined:
    Jul 23, 2004
    Messages:
    925
    Likes Received:
    0
    Location:
    Salinas de Garci Mendoza, Bolivia
    Hi Greg,

    The most effective method is to simply try establishing a socket connection to the Command Port.. if it fails you can safely assume CGate is NOT running. If it suceeds you can safely assume CGate IS running :)
     
    Duncan, Aug 4, 2004
    #2
  3. BeoLinker

    BeoLinker

    Joined:
    Aug 3, 2004
    Messages:
    58
    Likes Received:
    0
    Location:
    Wigan, UK
    Duncan,

    Thanks for info.

    I would have also liked to be able to determine whether a failed server connection was caused by a mis-configured C-Gate setup i.e. networks.txt, c-gateconfig.txt etc. which would require to state tests, i.e :-

    Config error = server not running + failed connection

    I am probably over complicating the task anway and this would suffice for the time being.

    Development of the "exception to the rule" usually takes longer than the rule itself!

    Thanks
    Greg...
     
    BeoLinker, Aug 4, 2004
    #3
  4. BeoLinker

    JackD

    Joined:
    Jul 29, 2004
    Messages:
    26
    Likes Received:
    0
    Location:
    Adelaide
    You can tell the difference

    You can tell the difference between a mis-configured C-Gate and no C-Gate at all. If it's mis-configured then you get the cgate message that it has started like this:
    Clipsal C-Gate(TM) v1.5.2.0 (build 1100)
    License file not found.
    Total network licenses: 0
    20040804-225814 800 cgate C-Gate started.
    20040804-225816 740 1 Opened cbus network: 1
    20040804-225816 840 1 PCI not responding at:COM2

    It just won't be able to talk to the network and will say PCI not responding. If C-Gate itself is mangled then if you go in a command window in your C-Gate directory and type "java -jar cgate.jar" then anything other than the usual message means that it's C-Gate that's having trouble and not the network.
     
    JackD, Aug 4, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.