• Download
  • Demo
  • Buy
  • API
  • Docs
  • Support
  • About
  • Contact
  • Login
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket

Namespace: socket

qz.socket

Calls related to interaction with communication sockets.
Source:
  • qz-tray.js, line 1691

Methods

(static) close(host, port)

Parameters:
Name Type Description
host string The connection hostname.
port number The connection port number.
Source:
  • qz-tray.js, line 1721

(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:
  • qz-tray.js, line 1706

(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:
  • qz-tray.js, line 1740

(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:
  • qz-tray.js, line 1766
Documentation generated by JSDoc 3.6.11

© 2023 qz | Privacy Policy