Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var client = net.connect(options, function () {
var header = 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' +
'Host: ' + options.host + ':' + options.port + '\r\n' +
authHeader + '\r\n' +
'Accept: multipart/x-mixed-replace\r\n\r\n';
client.write(header)
client.setKeepAlive(true,1000)
NetKeepAlive.setKeepAliveInterval(client,5000) // sets TCP_KEEPINTVL to 5s
NetKeepAlive.setKeepAliveProbes(client, 12) // 60s and kill the connection.
handleConnection(self, options);
});
this.socket = tls.connect(options, function () {
this.log('Connected');
this.socket.setKeepAlive(this.keepAliveConfig.enabled, this.keepAliveConfig.initial_delay);
keepAlive.setKeepAliveInterval(this.socket, this.keepAliveConfig.interval);
keepAlive.setKeepAliveProbes(this.socket, this.keepAliveConfig.probes);
// All responses from AC are received here as lines
carrier.carry(this.socket, this._readLine.bind(this));
}.bind(this));
var client = net.connect(options, function () {
var header = 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' +
'Host: ' + options.host + ':' + options.port + '\r\n' +
authHeader + '\r\n' +
'Accept: multipart/x-mixed-replace\r\n\r\n';
client.write(header)
client.setKeepAlive(true,1000)
NetKeepAlive.setKeepAliveInterval(client,5000) // sets TCP_KEEPINTVL to 5s
NetKeepAlive.setKeepAliveProbes(client, 12) // 60s and kill the connection.
handleConnection(self, options);
});
this.socket = tls.connect(options, function () {
this.log('Connected');
this.socket.setKeepAlive(this.keepAliveConfig.enabled, this.keepAliveConfig.initial_delay);
keepAlive.setKeepAliveInterval(this.socket, this.keepAliveConfig.interval);
keepAlive.setKeepAliveProbes(this.socket, this.keepAliveConfig.probes);
// All responses from AC are received here as lines
carrier.carry(this.socket, this._readLine.bind(this));
}.bind(this));