Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClientSecureChannelLayer

a ClientSecureChannelLayer represents the client side of the OPCUA secure channel.

Hierarchy

  • EventEmitter
    • ClientSecureChannelLayer

Index

Constructors

constructor

Properties

endpointUrl

endpointUrl: string

protocolVersion

protocolVersion: number

securityMode

securityMode: MessageSecurityMode

securityPolicy

securityPolicy: SecurityPolicy

Static defaultMaxListeners

defaultMaxListeners: number

Static defaultTransportTimeout

defaultTransportTimeout: number = 60 * 1000

Accessors

bytesRead

  • get bytesRead(): number

bytesWritten

  • get bytesWritten(): number

isConnecting

  • get isConnecting(): boolean

timedOutRequestCount

  • get timedOutRequestCount(): number

transactionsPerformed

  • get transactionsPerformed(): number

Methods

abortConnection

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

cancelPendingTransactions

close

create

  • establish a secure channel with the provided server end point.

    method

    create

    async
    example
    
       var secureChannel  = new ClientSecureChannelLayer({});
    
       secureChannel.on("end", function(err) {
            console.log("secure channel has ended",err);
            if(err) {
               console.log(" the connection was closed by an external cause such as server shutdown");
           }
       });
       secureChannel.create("opc.tcp://localhost:1234/UA/Sample", (err) => {
            if(err) {
                 console.log(" cannot establish secure channel" , err);
            } else {
                 console.log("secure channel has been established");
            }
       });
    

    Parameters

    • endpointUrl: string
    • callback: ErrorCallback

      the async callback function

    Returns void

dispose

  • dispose(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getCertificateChain

getDisplayName

  • getDisplayName(): string

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getPrivateKey

  • getPrivateKey(): PrivateKeyPEM | null

isOpened

  • isOpened(): boolean

isTransactionInProgress

  • isTransactionInProgress(): boolean

isValid

  • isValid(): boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

performMessageTransaction

  • performMessageTransaction(request: Request, callback: PerformTransactionCallback): void
  • perform a OPC-UA message transaction, asynchronously. During a transaction, the client sends a request to the server. The provided callback will be invoked at a later stage with the reply from the server, or the error.

    preconditions:

    • the channel must be opened
    example
       let secure_channel ; // get a  ClientSecureChannelLayer somehow
    
       const request = new BrowseRequest({...});
       secure_channel.performMessageTransaction(request, (err,response) => {
          if (err) {
            // an error has occurred
          } else {
             assert(response instanceof BrowseResponse);
            // do something with response.
          }
       });

    Parameters

    • request: Request
    • callback: PerformTransactionCallback

    Returns void

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc