目录

UDP Communication

Definition

API

Description

qg.createUDPSocket(Object object) (1117+)

Creates a UDP socket instance.

UDPSocket.bind(number port) (1117+)

Binds to an available port that is randomly allocated by the system or a specified port.

UDPSocket.setTTL(number ttl) (1117+)

Sets the IP_TTL socket option to define the maximum number of hops allowed during the transmission of an IP data packet.

UDPSocket.send(Object object) (1117+)

Sends a message to the specified IP address and port.

UDPSocket.connect(Object object) (1117+)

Preconnects to the specified IP address and port. This method must be used together with the UDPSocket.write(Object object) method.

UDPSocket.write(Object object) (1117+)

Sends a message to the specified IP address and port.

UDPSocket.close() (1117+)

Closes a UDP socket instance, which is equivalent to destroying the instance.

UDPSocket.onClose(function listener) (1117+)

Listens for closing events.

UDPSocket.offClose(function listener) (1117+)

Removes the callback function for closing events.

UDPSocket.onError(function listener) (1117+)

Listens for error events.

UDPSocket.offError(function listener) (1117+)

Removes the callback function for error events.

UDPSocket.onListening(function listener) (1117+)

Listens for events of starting to listen for data packet messages.

UDPSocket.offListening(function listener) (1117+)

Removes the callback function for events of starting to listen for data packet messages.

UDPSocket.onMessage(function listener) (1117+)

Listens for message receiving events.

UDPSocket.offMessage(function listener) (1117+)

Removes the callback function for message receiving events.

[h2]qg.createUDPSocket(Object object) (1117+)

[h2]UDPSocket.bind(number port) (1117+)

[h2]UDPSocket.setTTL(number ttl) (1117+)

[h2]UDPSocket.send(Object object) (1117+)

[h2]UDPSocket.connect(Object object) (1117+)

[h2]UDPSocket.write(Object object) (1117+)

[h2]UDPSocket.close() (1117+)

[h2]UDPSocket.onClose(function listener) (1117+)

[h2]UDPSocket.offClose(function listener) (1117+)

[h2]UDPSocket.onError(function listener) (1117+)

[h2]UDPSocket.offError(function listener) (1117+)

[h2]UDPSocket.onListening(function listener) (1117+)

[h2]UDPSocket.offListening(function listener) (1117+)

[h2]UDPSocket.onMessage(function listener) (1117+)

[h2]UDPSocket.offMessage(function listener) (1117+)