Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

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

Hierarchy

  • EventEmitter
    • ClientSecureChannelLayer

Index

Constructors

constructor

Properties

channelId

channelId: number

endpointUrl

endpointUrl: string

protocolVersion

protocolVersion: number

Readonly securityMode

securityMode: MessageSecurityMode

Readonly securityPolicy

securityPolicy: SecurityPolicy

Readonly Static captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static defaultTransactionTimeout

defaultTransactionTimeout: number

Static defaultTransportTimeout

defaultTransportTimeout: number

Readonly Static errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Static minTransactionTimeout

minTransactionTimeout: number

Accessors

bytesRead

  • get bytesRead(): number
  • Returns number

bytesWritten

  • get bytesWritten(): number
  • Returns number

isConnecting

  • get isConnecting(): boolean
  • true if the secure channel is trying to establish the connection with the server. In this case, the client may be in the middle of the backoff connection process.

    Returns boolean

timedOutRequestCount

  • get timedOutRequestCount(): number
  • Returns number

transactionsPerformed

  • get transactionsPerformed(): number
  • Returns number

Methods

abortConnection

  • Parameters

    Returns void

addListener

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

cancelPendingTransactions

  • Parameters

    Returns void

close

  • Close a client SecureChannel ,by sending a CloseSecureChannelRequest to the server.

    After this call, the connection is closed and no further transaction can be made.

    method

    close

    async

    Parameters

    Returns void

closeWithError

  • Parameters

    Returns void

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
  • Returns void

emit

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

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

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getCertificate

  • getCertificate(): Buffer
  • Returns Buffer

getCertificateChain

  • getCertificateChain(): Buffer
  • Returns Buffer

getClientNonce

  • getClientNonce(): Buffer
  • Returns Buffer

getDisplayName

  • getDisplayName(): string
  • Returns string

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getPrivateKey

  • getPrivateKey(): string
  • Returns string

isOpened

  • isOpened(): boolean
  • Returns boolean

isTransactionInProgress

  • isTransactionInProgress(): boolean
  • Returns boolean

isValid

  • isValid(): boolean
  • Returns boolean

listenerCount

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

    • event: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

off

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

on

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

once

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

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

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

prependOnceListener

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • Parameters

    • Optional event: string | symbol

    Returns ClientSecureChannelLayer

removeListener

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSecureChannelLayer

setMaxListeners

toString

  • toString(): string
  • Returns string

Static listenerCount

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

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc