Connection
1.6.5The Glue42 Gateway is a transport with domain specific protocols. It enables the communication between applications running in Glue42 Desktop. By default, it uses WebSockets for delivering messages to applications.
The Connection module is used to provide connectivity between the Glue42 JavaScript modules (Interop, Metrics, etc.) and the Glue42 Gateway.
Applications can use different events (connected
, disconnected
) to show connectivity status.
APIobject
Description
Connection to the Glue42 Gateway.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
protocolVersion | number | Protocol version of the current connection. |
Methods
connectedmethod
Signature
(callback: (server: string) => void) => () => void
Description
Subscribes for the event which fires when connected.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | (server: string) => void | Event handler function. |
disconnectedmethod
Signature
(callback: () => void) => () => void
Description
Subscribes for the event which fires when disconnected.
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | () => void |
loggedInmethod
Signature
(callback: () => void) => () => void
Description
Subscribes for the event which fires when the connection has managed to login (only for connections that support authentication).
Parameters
Name | Type | Required | Description |
---|---|---|---|
callback | () => void | Event handler function. |
reconnectmethod
Signature
() => Promise<void>
GW3Clientobject
Methods
sendmethod
Signature
(msg: object) => void
Parameters
Name | Type | Required | Description |
---|---|---|---|
msg | object |