Class: Socket

Socket()

Functions to read/write to web sockets

Constructor

new Socket()

Source:

Methods

(static) this.close(socketName)

Close socket connection
Parameters:
Name Type Description
socketName string Name of socket connection
Source:

(static) this.open(socketName, host, port, statusFunction)

Open a new socket connection
Parameters:
Name Type Description
socketName string Name to identify this socket connection
host string Hostname to which the socket streams should connect
port string TCP port number
statusFunction function Callback function that receives status updates
Source:

(static) this.read(socketName, maxLength, readFunction, failFunction)

Read from socket
Parameters:
Name Type Description
socketName string Name of socket connection
maxLength number Maximum number of bytes to read.
readFunction function Callback function for a successful read
failFunction function Callback function if read failed
Source:

(static) this.write(socketName, data, failFunction)

Write to socket
Parameters:
Name Type Description
socketName string Name of socket connection
data string Data string to send
failFunction function Callback function if write failed
Source: