How to use the azure-iot-common.results.Disconnected function in azure-iot-common

To help you get started, we’ve selected a few azure-iot-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-iot-sdk-node / device / transport / amqp / src / amqp.ts View on Github external
_onEnter: (callback, err) => {
            if (callback) {
              if (err) {
                callback(err);
              } else {
                callback(null, new results.Disconnected());
              }
            } else if (err) {
              this.emit('error', err);
            }
          },
          connect: (connectCallback) => this._fsm.transition('connecting', connectCallback),
github Azure / azure-iot-sdk-node / device / core / src / module_client.ts View on Github external
this._enableInputMessages((err) => {
            if (err) {
              /*Codes_SRS_NODE_MODULE_CLIENT_16_102: [If the retry policy fails to reestablish the C2D functionality a `disconnect` event shall be emitted with a `results.Disconnected` object.]*/
              this.emit('disconnect', new results.Disconnected(err));
            }
          });
        }
github Azure / azure-iot-sdk-node / service / lib / client.js View on Github external
Client.prototype._disconnectHandler = function (reason) {
  /*Codes_SRS_NODE_IOTHUB_CLIENT_16_004: [** The `disconnect` event shall be emitted when the client is disconnected from the server.]*/
  var evt = new results.Disconnected();
  evt.reason = reason;
  this.emit('disconnect', evt);
};
github Azure / azure-iot-sdk-node / device / core / src / device_client.ts View on Github external
this._enableC2D((err) => {
            if (err) {
              /*Codes_SRS_NODE_DEVICE_CLIENT_16_102: [If the retry policy fails to reestablish the C2D functionality a `disconnect` event shall be emitted with a `results.Disconnected` object.]*/
              this.emit('disconnect', new results.Disconnected(err));
            }
          });
        }
github Azure / azure-iot-sdk-node / common / transport / amqp / src / amqp.ts View on Github external
          disconnect: (callback) => callback(null, new results.Disconnected()),
          attachSenderLink: (endpoint, linkOptions, callback) => callback(new errors.NotConnectedError()),
github Azure / azure-iot-sdk-node / common / transport / amqp / src / amqp.ts View on Github external
_onEnter: (disconnectCallback, err, result) => {
            if (disconnectCallback) {
              if (err) {
                this._safeCallback(disconnectCallback, err);
              } else {
                this._safeCallback(disconnectCallback, null, new results.Disconnected());
              }
            } else if (this._disconnectHandler) {
              debug('calling upper layer disconnect handler');
              debug('error passed to disconnect handler is: ' + this._getErrorName(err || new errors.NotConnectedError('rhea: connection disconnected')));
              this._disconnectHandler(err || new errors.NotConnectedError('rhea: connection disconnected'));
            }
          },
          amqpError: (err) => {
github Azure / azure-iot-sdk-node / device / transport / mqtt / src / mqtt.ts View on Github external
          disconnect: (callback) => callback(null, new results.Disconnected()),
          connect: (callback) => {
github Azure / azure-iot-sdk-node / service / src / amqp.ts View on Github external
this._fsm.handle('disconnect', (err) => {
      if (err) {
        done(getTranslatedError(err, 'error while disconnecting'));
      } else {
        done(null, new results.Disconnected());
      }
    });
  }
github Azure / azure-iot-sdk-node / device / transport / mqtt / src / mqtt.ts View on Github external
this._mqtt.disconnect((err, result) => {
              this._fsm.transition('disconnected', disconnectCallback, err, new results.Disconnected(result));
            });
          },
github Azure / azure-iot-sdk-node / device / transport / amqp / src / amqp.ts View on Github external
disconnect: (disconnectCallback) => {
            if (disconnectCallback) {
              disconnectCallback(null, new results.Disconnected());
            }
          },
          sendEvent: (message, sendCallback) => {