UDPSocket.webidl (2072B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 * You can obtain one at http://mozilla.org/MPL/2.0/. 5 * 6 * The origin of this IDL file is 7 * http://www.w3.org/2012/sysapps/tcp-udp-sockets/#interface-udpsocket 8 * http://www.w3.org/2012/sysapps/tcp-udp-sockets/#dictionary-udpoptions 9 */ 10 11 dictionary UDPOptions { 12 DOMString localAddress; 13 unsigned short localPort; 14 DOMString remoteAddress; 15 unsigned short remotePort; 16 boolean addressReuse = true; 17 boolean loopback = false; 18 }; 19 20 [Pref="dom.udpsocket.enabled", 21 ChromeOnly, 22 Exposed=Window] 23 interface UDPSocket : EventTarget { 24 [Throws] 25 constructor(optional UDPOptions options = {}); 26 27 readonly attribute DOMString? localAddress; 28 readonly attribute unsigned short? localPort; 29 readonly attribute DOMString? remoteAddress; 30 readonly attribute unsigned short? remotePort; 31 readonly attribute boolean addressReuse; 32 readonly attribute boolean loopback; 33 readonly attribute SocketReadyState readyState; 34 readonly attribute Promise<undefined> opened; 35 readonly attribute Promise<undefined> closed; 36 // readonly attribute ReadableStream input; //Bug 1056444: Stream API is not ready 37 // readonly attribute WriteableStream output; //Bug 1056444: Stream API is not ready 38 attribute EventHandler onmessage; //Bug 1056444: use event interface before Stream API is ready 39 Promise<undefined> close (); 40 [Throws] undefined joinMulticastGroup (DOMString multicastGroupAddress); 41 [Throws] undefined leaveMulticastGroup (DOMString multicastGroupAddress); 42 [Throws] boolean send ((DOMString or Blob or ArrayBuffer or ArrayBufferView) data, optional DOMString? remoteAddress, optional unsigned short? remotePort); //Bug 1056444: use send method before Stream API is ready 43 };