Jump to content

How to fast check if HOST & Bricklet are connected


rwblinn

Recommended Posts

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.

Link zu diesem Kommentar
Share on other sites

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...