Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

Hierarchy

Index

Constructors

constructor

  • Returns TCP_transport

Properties

_socket

_socket: Socket

bytesRead

bytesRead: number

bytesWritten

bytesWritten: number

chunkReadCount

chunkReadCount: number

chunkWrittenCount

chunkWrittenCount: number

name

name: string

protocolVersion

protocolVersion: number

indicates the version number of the OPCUA protocol used

default

0

Accessors

isDisconnecting

  • get isDisconnecting(): boolean
  • Returns boolean

timeout

  • get timeout(): number
  • set timeout(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

Methods

createChunk

  • createChunk(msgType: string, chunkType: string, length: number): Buffer
  • createChunk is used to construct a pre-allocated chunk to store up to length bytes of data. The created chunk includes a prepended header for chunk_type of size self.headerSize.

    method

    createChunk

    Parameters

    • msgType: string
    • chunkType: string

      chunk type. should be 'F' 'C' or 'A'

    • length: number

    Returns Buffer

    a buffer object with the required length representing the chunk.

    Note:

    • only one chunk can be created at a time.
    • a created chunk should be committed using the write method before an other one is created.

disconnect

  • disconnect the TCP layer and close the underlying socket. The "close" event will be emitted to the observers with err=null.

    method

    disconnect

    async

    Parameters

    Returns void

dispose

  • dispose(): void
  • Returns void

isValid

  • isValid(): boolean
  • Returns boolean

on

  • on(eventName: "message", eventHandler: (message: Buffer) => void): TCP_transport
  • on(eventName: "socket_closed", eventHandler: (err: Error) => void): TCP_transport
  • on(eventName: "close", eventHandler: (err: Error) => void): TCP_transport
  • Parameters

    • eventName: "message"
    • eventHandler: (message: Buffer) => void
        • (message: Buffer): void
        • Parameters

          • message: Buffer

          Returns void

    Returns TCP_transport

  • Parameters

    • eventName: "socket_closed"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns TCP_transport

  • Parameters

    • eventName: "close"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns TCP_transport

once

  • once(eventName: "message", eventHandler: (message: Buffer) => void): TCP_transport
  • once(eventName: "socket_closed", eventHandler: (err: Error) => void): TCP_transport
  • once(eventName: "close", eventHandler: (err: Error) => void): TCP_transport
  • Parameters

    • eventName: "message"
    • eventHandler: (message: Buffer) => void
        • (message: Buffer): void
        • Parameters

          • message: Buffer

          Returns void

    Returns TCP_transport

  • Parameters

    • eventName: "socket_closed"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns TCP_transport

  • Parameters

    • eventName: "close"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns TCP_transport

prematureTerminate

  • prematureTerminate(err: Error): void
  • Parameters

    • err: Error

    Returns void

write

  • write(messageChunk: Buffer): void
  • write the message_chunk on the socket.

    method

    write

    Parameters

    • messageChunk: Buffer

      Notes:

      • the message chunk must have been created by createChunk.
      • once a message chunk has been written, it is possible to call createChunk again.

    Returns void

Generated using TypeDoc