rwblinn Geschrieben June 6, 2014 at 06:35 Geschrieben June 6, 2014 at 06:35 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 Zitieren
photron Geschrieben June 6, 2014 at 13:17 Geschrieben June 6, 2014 at 13:17 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. Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.