Skip to content

Commit

Permalink
extract ClientSecureChannelLayer.defaultTransportTimeout in separate …
Browse files Browse the repository at this point in the history
…global variable
  • Loading branch information
erossignon committed Apr 28, 2017
1 parent 039c297 commit 65fb910
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/client/client_secure_channel_layer.js
Expand Up @@ -133,6 +133,7 @@ function _on_message_received(response, msgType, requestId) {

var g_channelId = 0;


/**
* a ClientSecureChannelLayer represents the client side of the OPCUA secure channel.
* @class ClientSecureChannelLayer
Expand All @@ -146,14 +147,14 @@ var g_channelId = 0;
* @param [options.serverCertificate=null] the serverCertificate (required if securityMode!=None)
* @param options.parent {OPCUAClientBase} parent
* @param [options.factory] an factory that provides a method createObjectId(id) for the message builder
* @param [options.transportTimeout = 10000 = 10 seconds] the transport timeout interval in ms
* @param [options.transportTimeout = ClientSecureChannelLayer.defaultTransportTimeout = 10 seconds] the transport timeout interval in ms
* @param [options.connectionStrategy] {Object}
* @param [options.connectionStrategy.maxRetry = 10]
* @param [options.connectionStrategy.initialDelay = 10]
* @param [options.connectionStrategy.maxDelay = 10000]
* @constructor
*/
var ClientSecureChannelLayer = function (options) {
function ClientSecureChannelLayer(options) {

options = options || {};

Expand Down Expand Up @@ -221,7 +222,7 @@ var ClientSecureChannelLayer = function (options) {

self._timedout_request_count = 0;

self.transportTimeout = options.transportTimeout || 10000;
self.transportTimeout = options.transportTimeout || ClientSecureChannelLayer.defaultTransportTimeout;

self.channelId = g_channelId;
g_channelId += 1;
Expand All @@ -239,6 +240,8 @@ var ClientSecureChannelLayer = function (options) {
};
util.inherits(ClientSecureChannelLayer, EventEmitter);

ClientSecureChannelLayer.defaultTransportTimeout = 10 * 1000; // 1 minute

/**
* @method getPrivateKey
* @return {Buffer} the privateKey
Expand Down

0 comments on commit 65fb910

Please sign in to comment.