ReadonlyaddressWhether address reuse is enabled.
ReadonlyclosedPromise resolving when the socket is closed.
Optional ReadonlylocalThe local address bound to the socket.
Optional ReadonlylocalThe local port bound to the socket.
ReadonlyloopbackWhether loopback is enabled.
Event handler for incoming messages. Bug 1056444: use event interface before Stream API is ready
ReadonlyopenedPromise resolving when the socket is opened.
ReadonlyreadyThe current state of the socket.
Optional ReadonlyremoteThe remote address the socket is connected to.
Optional ReadonlyremoteThe remote port the socket is connected to.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsCloses the socket.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optionaloptions: boolean | EventListenerOptionsSends data over the socket.
The data to send.
OptionalremoteAddress: stringOptional remote address if not connected.
OptionalremotePort: numberOptional remote port if not connected.
True if sent successfully.
Represents a UDP socket. Requires "dom.udpsocket.enabled" system preference. Requires "udp-socket" permission.