Calls related to interaction with communication sockets.
- Source:
Methods
(static) close(host, port)
Parameters:
Name |
Type |
Description |
host |
string
|
The connection hostname. |
port |
number
|
The connection port number. |
- Source:
(static) open(host, port, optionsopt)
Opens a network port for sending and receiving data.
Parameters:
Name |
Type |
Attributes |
Description |
host |
string
|
|
The connection hostname. |
port |
number
|
|
The connection port number. |
options |
Object
|
<optional>
|
Network socket configuration.
Properties
Name |
Type |
Attributes |
Default |
Description |
encoding |
string
|
<optional>
|
'UTF-8'
|
Character set for communications. |
|
- Source:
(static) sendData(host, port, data)
Send data over an open socket.
Parameters:
Name |
Type |
Description |
host |
string
|
The connection hostname. |
port |
number
|
The connection port number. |
data |
string
|
Object
|
Data to be sent over the port.
Properties
Name |
Type |
Attributes |
Default |
Description |
type |
string
|
<optional>
|
'PLAIN'
|
Valid values [PLAIN] |
data |
string
|
|
|
Data to be sent over the port. |
|
- Source:
(static) setSocketCallbacks(calls)
List of functions called for any response from open network sockets.
Event data will contain {string} host
and {number} port
for all types.
For RECEIVE types, {string} response
.
For ERROR types, {string} exception
.
Parameters:
Name |
Type |
Description |
calls |
function
|
Array.<function()>
|
Single or array of Function({Object} eventData) calls. |
- Source: