Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / TCPServerSocket.webidl
blob259bd3f6b41775670675f9908cf8062c99022e86
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/. */
6 /**
7  * TCPServerSocket
8  *
9  * An interface to a server socket that can accept incoming connections for gaia apps.
10  */
12 dictionary ServerSocketOptions {
13   TCPSocketBinaryType binaryType = "string";
16 [Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
17  Exposed=Window]
18 interface TCPServerSocket : EventTarget {
19   [Throws]
20   constructor(unsigned short port, optional ServerSocketOptions options = {},
21               optional unsigned short backlog = 0);
23    /**
24    * The port of this server socket object.
25    */
26   readonly attribute unsigned short localPort;
28   /**
29    * The "connect" event is dispatched when a client connection is accepted.
30    * The event object will be a TCPServerSocketEvent containing a TCPSocket
31    * instance, which is used for communication between client and server.
32    */
33   attribute EventHandler onconnect;
35   /**
36    * The "error" event will be dispatched when a listening server socket is
37    * unexpectedly disconnected.
38    */
39   attribute EventHandler onerror;
41   /**
42    * Close the server socket.
43    */
44   undefined close();