Geschrieben June 6, 2014 at 06:356. Jun 2014 Hi, what is the best way, in JavaScript, to fast (=immediate) check if a) the HOST is reachable and b) the bricklet is connencted. There should no delay in response after trying to connect. If an error, then the result to be messaged to the user. Appreciated, Rob
Geschrieben June 6, 2014 at 13:176. Jun 2014 Create an IPConnection object and connect it to the host. If connect fails then the host is not reachable. With the connected IPConnection object create an object for the Bricklet and call its getIdentity method. If the method fails with a timeout then the Bricklet is not connected. The default timeout is 2.5 seconds. If that's too long you can make it shorter. How short it can be and still work reliable depends on the TCP/IP connection speed. You'll have to experiment.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.