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.
client side callback invoked upon successfull connection with the server
optional callback invoked upon an unrecoverable communication error with the Fovia Web Server
optional callback invoked when the client becomes disconencted from the Fovia Web Server
network address of the Node.js server. The default value is the IP address that serves up the client's web page
port to use, if not specified, the location.port is used
protocol to use, if not specified, the location.protocol is used
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)
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 class that requests and establishes a connection between the client and the Node.js server