sud.createUDPSocket
js
UDPSocket sud.createUDPSocket(Object object)Creates a UDP Socket instance.
Parameters
- Object object: input parameter
object description:
If no object is passed, a udp4 type instance is created by default, using the IPv4 protocol and without address reuse.
If object is a string, an instance of the specified UDPSocket type is created according to the value. Available types are udp4 (IPv4 protocol) or udp6 (IPv6 protocol).
If object is an object, the available properties are as follows:
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| type | string | Yes | The UDPSocket type to create, either udp4 or udp6 | |
| reuseAddr | boolean | Yes | Whether to allow port reuse on bind |
Return Value
- UDPSocket: a
UDPSocketobject
