Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var self = this; // 'this' is not available in the success function of $http.get
this.user = null;
this.closeEvent = null;
this.outstanding_settles = {};
this.error_queue = [];
this.admin_disabled = true;
this.address_index = {};
this.connection_index = {};
Object.defineProperty(this, 'addresses', { get: function () { return get_items_from_index(self.address_index); } });
Object.defineProperty(this, 'connections', { get: function () { return get_items_from_index(self.connection_index); } });
this.address_types = [];
this.address_space_type = '';
this._additional_listeners = [];
var ws = rhea.websocket_connect(WebSocket);
var connectionDetails = ws("wss://" + location.hostname + ":" + location.port + "/websocket", ["binary", "AMQPWSB10"]);
this.connection = rhea.create_connection({"connection_details": connectionDetails, "reconnect":15000, rejectUnauthorized:true});
this.connection.on('message', this.on_message.bind(this));
this.connection.on('connection_open', function (context) {
self.update_periodic_deltas_interval = setInterval(self.update_periodic_deltas.bind(self), 5000);
self.update_depth_series_interval = setInterval(self.update_depth_series.bind(self), 30000);
if (self.callback) {
self.callback("peer_connected");
}
});
this.connection.on('disconnected', function (context) {
self.closeEvent = context.error;
if (self.update_periodic_deltas_interval) {
clearInterval(self.update_periodic_deltas_interval);
self.update_periodic_deltas_interval = null;
}
if (self.update_depth_series_interval) {
clearInterval(self.update_depth_series_interval);
constructor(options?: rhea.ConnectionOptions) {
this.options = options;
this._connection = rhea.create_connection(options);
}