Start from base library version 2.7.0. Please remaining backward compatible.
An UDP Socket instance. Use IPv4 protocol by default.
Binds an available port randomly assigned by the system.
Sends messages to the specified IP and port.
Closes (Terminates) a UDP Socket instance. After closing, the UDP Socket instance can no longer send messages. Calling
UDPSocket.send will trigger an error event, and the callback function for the message event will not be executed. After the
UDPSocket instance is created, it will be strongly referenced by Native to ensure that it is not collected by GC. After calling
UDPSocket.close, the strong reference to it will be removed, and the UDPSocket instance will follow the GC rules.
Listens on the disabling event.
Un-listens on the disabling event.
Listens on the error event.
Un-listens on the error event.
Listens on the event of starting listening on data packet messages.
Un-listens on the event of starting listening on data packet messages.
Listens on the event of receiving messages.
Un-listens on the event of receiving messages.