Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ServerSecureChannelLayer.prototype.init = function(socket, callback) {
const self = this;
self.transport = new ServerTCP_transport();
self.transport.timeout = self.timeout;
self.transport.init(socket, function(err) {
if (err) {
callback(err);
} else {
// bind low level TCP transport to messageBuilder
self.transport.on("message", function(message_chunk) {
assert(self.messageBuilder);
self.messageBuilder.feed(message_chunk);
});
debugLog("ServerSecureChannelLayer : Transport layer has been initialized");
debugLog("... now waiting for OpenSecureChannelRequest...");
ServerSecureChannelLayer.registry.register(self);
super();
this._on_response = null;
this.__verifId = {};
this._abort_has_been_called = false;
this.endpoint = null;
this._remoteAddress = "";
this._remotePort = 0;
this.receiverCertificate = null;
this.receiverPublicKey = null;
this.receiverPublicKeyLength = 0;
this.clientCertificate = null;
this.clientNonce = null;
this.transport = new ServerTCP_transport();
this.__hash = getNextChannelId();
assert(this.__hash > 0);
this.channelId = null;
this.revisedLifetime = 0;
this.parent = options.parent;
this.protocolVersion = 0;
this.lastTokenId = 0;
this.timeout = options.timeout || 30000; // connection timeout
debugLog("server secure channel layer tiemput = ", this.timeout);