- add third_party src.
[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 onhalfclose();
20     static void onerror();
21     static void ondata();
22   };
23
24   interface Functions {
25     static void close();
26     static void halfclose();
27     static void suspend();
28     static void resume();
29
30     [nocompile] static boolean send(object data);
31
32     // send() can take up to four different types of arguments. We try to
33     // detect what kind of argument we have and route to a more specialized
34     // handler.
35
36     [nodoc] static boolean sendDOMString(DOMString data);
37     [nodoc] static boolean sendBlob([instanceOf=Blob] object data);
38     [nodoc] static boolean sendArrayBuffer(ArrayBuffer data);
39     [nodoc] static boolean sendArrayBufferView([instanceOf=ArrayBufferView] object data);
40
41     [nodoc] static void init(DOMString remoteAddress,
42                              long remotePort,
43                              optional TCPOptions options);
44     [nodoc] static void destroy();
45   };
46 };