Class FoviaAPI

Static class that requests and establishes a connection between the client and the Node.js server

Hierarchy

  • FoviaAPI

Index

Properties

Static serverVersion

serverVersion: any = undefined

Methods

Static Private loadSocketIO

  • loadSocketIO(options: any): any
  • Parameters

    • options: any

    Returns any

Static Private loadcbortype

  • loadcbortype(options: any): any
  • Parameters

    • options: any

    Returns any

Static Private loadpromisetype

  • loadpromisetype(options: any, callback: any): any
  • Parameters

    • options: any
    • callback: any

    Returns any

Static Private loadtypedarraydefs

  • loadtypedarraydefs(options: any): any
  • Parameters

    • options: any

    Returns any

Static requestServerConnection

  • requestServerConnection(connectionCallback: Function, fatalServerErrorHandler?: Function, sessionDisconnectHandler?: Function, nodeServerIP?: string, port?: any, protocol?: string, transport?: string): void
  • This method establishes the communication between the client and the Node.JS server. This is the first call to the foviaAPI, and registers the callback that is invokved after the connection is established. Additional callbacks incldue the fatalSeverError handler and the sessionDisconnect handler.

    This is the only Fovia API that does not utilize the Promise interface. This ensures that the API will be properly initialized, even if the browser does not support Promises, and allows the API to register a polyfill for the Promise functionality for those browwser that lack Promise support.

    Parameters

    • connectionCallback: Function

      client side callback invoked upon successfull connection with the server

    • Optional fatalServerErrorHandler: Function

      optional callback invoked upon an unrecoverable communication error with the Fovia Web Server

    • Optional sessionDisconnectHandler: Function

      optional callback invoked when the client becomes disconencted from the Fovia Web Server

    • Optional nodeServerIP: string

      network address of the Node.js server. The default value is the IP address that serves up the client's web page

    • Optional port: any

      port to use, if not specified, the location.port is used

    • Optional protocol: string

      protocol to use, if not specified, the location.protocol is used

    • Optional transport: string

      typically defined by Node.js, but will use this value (such as websockets) if specified

      NOTE: nodeServerIP and port must both be specified or both empty (which uses the defaults)

    Returns void

    This is an asynchronous method does not return any value. The connecitonCallback parameter reports any error condition. All calls return non-zero for error or zero (Fovia.ReturnCode.ok) for successs.

Static Private startTimer

  • startTimer(duration: any): void
  • Parameters

    • duration: any

    Returns void