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

securityToken

securityToken: ChannelSecurityToken

Static defaultTransactionTimeout

defaultTransactionTimeout: number

Static defaultTransportTimeout

defaultTransportTimeout: number

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

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

getCertificate

  • getCertificate(): Buffer
  • Returns Buffer

getCertificateChain

  • getCertificateChain(): Buffer
  • Returns Buffer

getClientNonce

  • getClientNonce(): Buffer
  • Returns Buffer

getDisplayName

  • getDisplayName(): string
  • Returns string

getPrivateKey

  • getPrivateKey(): string
  • Returns string

isOpened

  • isOpened(): boolean
  • Returns boolean

isTransactionInProgress

  • isTransactionInProgress(): boolean
  • Returns boolean

isValid

  • isValid(): boolean
  • Returns boolean

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

toString

  • toString(): string
  • Returns string

Generated using TypeDoc