lib/server/server_end_point.js
/**
 * OPCUAServerEndPoint a Server EndPoint.
 * @class OPCUAServerEndPoint
 *
 * A sever end point is listening to one port
 *
 * @param options {Object}
 * @param options.port                                  {Number} the tcp port
 * @param options.certificateChain                      {Buffer} the DER certificate chain
 * @param options.privateKey                            {String} PEM string of the private key
 * @param [options.defaultSecureTokenLifetime=600000]   {Number} the default secure token lifetime
 * @param [options.timeout=30000]                       {Number} the  timeout for the TCP HEL/ACK transaction (in ms)
 * @param [options.maxConnections = 20 ]                {Number} the maximum number of connection allowed on the TCP server socket
 * @param options.serverInfo                            {ApplicationDescription}
 * @param [options.serverInfo.applicationUri]           {String}
 * @param [options.serverInfo.productUri]               {String}
 * @param [options.serverInfo.applicationName]          {LocalizedText}
 * @param [options.serverInfo.gatewayServerUri]         {String|null}
 * @param [options.serverInfo.discoveryProfileUri]      {String|null}
 * @param [options.serverInfo.discoveryUrls]            {String[]}
 * @param options.objectFactory
 * @constructor
 *
 * note:
 *   see OPCUA Release 1.03 part 4 page 108 7.1 ApplicationDescription
 */


A sever end point is listening to one port



see OPCUA Release 1.03 part 4 page 108 7.1 ApplicationDescription
A sever end point is listening to one port see OPCUA Release 1 . 03 part 4 page 108 7 . 1 ApplicationDescription
function OPCUAServerEndPoint(options) {
    var self = this;
    assert(!options.hasOwnProperty("certificate"),"expecting a certificateChain instead");
    assert(options.hasOwnProperty("certificateChain"),"expecting a certificateChain");
    assert(options.hasOwnProperty("privateKey"));
    assert(typeof(options.privateKey) === "string");
    options = options || {};
    options.port = options.port || 0;
    self.port = parseInt(options.port, 10);
    assert(_.isNumber(self.port));
    self._certificateChain = options.certificateChain;
    self._privateKey = options.privateKey;
    self._channels = {};
    self.defaultSecureTokenLifetime = options.defaultSecureTokenLifetime || 600000;
    self.maxConnections = options.maxConnections || 20;
    self.timeout = options.timeout || 30000;
    self._server = null;
    self._setup_server();
    self._endpoints = [];
    self.objectFactory = options.objectFactory;
    this.bytesWrittenInOldChannels = 0;
    this.bytesReadInOldChannels = 0;
    this.transactionsCountOldChannels = 0;
    this.securityTokenCountOldChannels = 0;
    this.serverInfo = options.serverInfo;
    assert(_.isObject(this.serverInfo));
}
function OPCUAServerEndPoint ( options ) { var self = this ; assert ( ! options . hasOwnProperty ( "certificate" ) , "expecting a certificateChain instead" ) ; assert ( options . hasOwnProperty ( "certificateChain" ) , "expecting a certificateChain" ) ; assert ( options . hasOwnProperty ( "privateKey" ) ) ; assert ( typeof ( options . privateKey ) === "string" ) ; options = options || { } ; options . port = options . port || 0 ; self . port = parseInt ( options . port , 10 ) ; assert ( _ . isNumber ( self . port ) ) ; self . _certificateChain = options . certificateChain ; self . _privateKey = options . privateKey ; self . _channels = { } ; self . defaultSecureTokenLifetime = options . defaultSecureTokenLifetime || 600000 ; self . maxConnections = options . maxConnections || 20 ; self . timeout = options . timeout || 30000 ; self . _server = null ; self . _setup_server ( ) ; self . _endpoints = [ ] ; self . objectFactory = options . objectFactory ; this . bytesWrittenInOldChannels = 0 ; this . bytesReadInOldChannels = 0 ; this . transactionsCountOldChannels = 0 ; this . securityTokenCountOldChannels = 0 ; this . serverInfo = options . serverInfo ; assert ( _ . isObject ( this . serverInfo ) ) ; }
OPCUAServerEndPoint a Server EndPoint.
OPCUAServerEndPoint a Server EndPoint .