Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
StompRService.prototype.initStompClient = function () {
// disconnect if connected
this.disconnect();
// url takes precedence over socketFn
if (typeof (this._config.url) === 'string') {
this.client = client(this._config.url);
}
else {
this.client = over(this._config.url);
}
// Configure client heart-beating
this.client.heartbeat.incoming = this._config.heartbeat_in;
this.client.heartbeat.outgoing = this._config.heartbeat_out;
// Auto reconnect
this.client.reconnect_delay = this._config.reconnect_delay;
if (!this._config.debug) {
this.debug = function () { };
}
// Set function to debug print messages
this.client.debug = this.debug;
// Default messages
this.setupOnReceive();