Jump to content

Recommended Posts

Geschrieben

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

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.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...