Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / xwalk / sysapps / raw_socket / tcp_socket.idl
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // RawSocket API - TCPSocket
6 namespace tcp_socket {
7   dictionary TCPOptions {
8     DOMString localAddress;
9     long localPort;
10     boolean addressReuse;
11     boolean noDelay;
12     boolean useSecureTransport;
13   };
14
15   interface Events {
16     static void ondrain();
17     static void onopen();
18     static void onclose();
19     static void onerror();
20     static void ondata();
21   };
22
23   interface Functions {
24     static void close();
25     static void halfclose();
26     static void suspend();
27     static void resume();
28
29     [nocompile] static boolean send(object data);
30
31     // send() can take up to four different types of arguments. We try to
32     // detect what kind of argument we have and route to a more specialized
33     // handler.
34
35     [nodoc] static boolean sendDOMString(DOMString data);
36     [nodoc] static boolean sendBlob([instanceOf=Blob] object data);
37     [nodoc] static boolean sendArrayBuffer(ArrayBuffer data);
38     [nodoc] static boolean sendArrayBufferView([instanceOf=ArrayBufferView] object data);
39
40     [nodoc] static void init(DOMString remoteAddress,
41                              long remotePort,
42                              optional TCPOptions options);
43     [nodoc] static void destroy();
44   };
45 };