Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. [gelöst]socket problem

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst]socket problem

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stoffel67 last edited by stoffel67

      Hallo,
      ich mache eine "socket" Verbindung zu einem Device auf ( Solarthermieanlage)

      const client = new Net.Socket();
      // Send a connection request to the server.
      client.connect({ port: port, host: host }, function() {.....
      
      

      und lese Daten mit

      client.on('data', function(....
      

      das funktioniert auch alles wunderbar,
      aber wenn ich das Script stoppe, läuft es trotzdem munter weiter!
      wie kann ich diese socket-Verbindung beenden?

      Asgothian 1 Reply Last reply Reply Quote 0
      • Asgothian
        Asgothian Developer @stoffel67 last edited by

        @stoffel67 Du musst deinen Client auch "ausschalten".. Dazu kannst du den "onStop" event nutzen (siehe auch hier: https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/en/javascript.md#onstop)

        A.

        S 1 Reply Last reply Reply Quote 0
        • S
          stoffel67 @Asgothian last edited by

          @asgothian
          Ohhh, kannte ich noch nicht...wieder was gelernt
          Vielen Dank, funktioniert 👍

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          870
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

          javascript
          2
          3
          119
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo