# UDPSocket.close()

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.