Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectionTCP

vMix Connection via TCP

Hierarchy

  • ConnectionTCP

Index

Constructors

  • new ConnectionTCP(host?: string, options?: { autoReconnect?: boolean; debug?: boolean; debugBuffers?: boolean; disableAutoConnectOnInit?: boolean; onDataCallback?: Function; port?: number; useDataListenersAsFallback?: boolean }): ConnectionTCP
  • Constructor of ConnectionTCP

    The socket automatically attempts to connect by default unless the option 'disableAutoConnectOnInit' is set to true

    Parameters

    • host: string = DEFAULT_HOST
    • options: { autoReconnect?: boolean; debug?: boolean; debugBuffers?: boolean; disableAutoConnectOnInit?: boolean; onDataCallback?: Function; port?: number; useDataListenersAsFallback?: boolean } = {}
      • Optional autoReconnect?: boolean
      • Optional debug?: boolean
      • Optional debugBuffers?: boolean
      • Optional disableAutoConnectOnInit?: boolean
      • Optional onDataCallback?: Function
      • Optional port?: number
      • Optional useDataListenersAsFallback?: boolean

    Returns ConnectionTCP

Properties

_autoReconnect: boolean = true
_buffer: Buffer = ...
_debug: boolean = false
_debugBuffer: boolean = false

Print debug messages regarding buffer

Disabled by default

_host: string = DEFAULT_HOST
_isConnected: boolean = false

Connection state

_isRetrying: boolean = false
_listeners: {} = {}

All listeners

Type declaration

  • [key: string]: Function[]
_port: number = DEFAULT_TCP_PORT
_reconnectionInterval: null | Timeout = null
_reconnectionIntervalTimeout: number = 10000
_socket: Socket = ...

Node TCP socket client to vMix instance

_useDataListenersAsFallback: boolean = true

Emit vMix messages to listeners registered for data as a fallback solution if no listener is registered in the specific custom-listener-type

Enabled by default

Methods

  • _emitMessage(message: string): void
  • _emitTallyMessage(message: string): void
  • _emitVersionMessage(message: string): void
  • _processBuffer(): void
  • _processBufferNonXMLmessage(messageType: string, messageStatus: string, firstMessage: string, firstMessageByteLength: number): void
  • Parameters

    • messageType: string
    • messageStatus: string
    • firstMessage: string
    • firstMessageByteLength: number

    Returns void

  • _processBufferXMLmessage(firstMessage: string, firstMessageLength: number, firstMessageParts: string[]): void
  • Process buffer XML message

    Parameters

    • firstMessage: string
    • firstMessageLength: number
    • firstMessageParts: string[]

    Returns void

  • _sendMessageToSocket(message: string): Promise<void>
  • _setHost(host: string): void
  • _setPort(port: number): void
  • clearAllListeners(): void
  • connect(host?: string, port?: number): Promise<void>
  • Connect

    Attempt to establish connection to socket of vMix instance

    Parameters

    • Optional host: string
    • Optional port: number

    Returns Promise<void>

  • connected(): boolean
  • connecting(): boolean
  • emitActivatorsMessage(message: string): void
  • emitXmlMessage(message: string): void
  • ensureMessageEnding(message: string): string
  • off(listenerType: string, callbackSignature: Function): void
  • Unregister listeners of specific event-type and with a specific callback function-signature

    Parameters

    • listenerType: string
    • callbackSignature: Function

    Returns void

  • on(type: string, callback: Function): void
  • shutdown(): void
  • socket(): Socket

Generated using TypeDoc