View Full Version : Detecting whether the C-Gate server is running?
BeoLinker
04 Aug 04, 07:01 PM
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...
Duncan
04 Aug 04, 07:55 PM
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...
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 :-)
BeoLinker
04 Aug 04, 08:31 PM
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...
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.
vBulletin® v3.7.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.