| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // File-level comment to appease parser. Eventually this will not be necessary. | 5 // File-level comment to appease parser. Eventually this will not be necessary. |
| 6 | 6 |
| 7 [nodoc] namespace experimental.socket { | 7 [nodoc] namespace experimental.socket { |
| 8 // The socket options. | 8 // The socket options. |
| 9 dictionary CreateOptions { | 9 dictionary CreateOptions { |
| 10 // The schema generator does not support dictionaries without any fields. | 10 // The schema generator does not support dictionaries without any fields. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 long port, | 94 long port, |
| 95 BindCallback callback); | 95 BindCallback callback); |
| 96 | 96 |
| 97 // Disconnects the socket. For UDP sockets, <code>disconnect</code> is a | 97 // Disconnects the socket. For UDP sockets, <code>disconnect</code> is a |
| 98 // non-operation but is safe to call. | 98 // non-operation but is safe to call. |
| 99 // |socketId| : The socketId. | 99 // |socketId| : The socketId. |
| 100 static void disconnect(long socketId); | 100 static void disconnect(long socketId); |
| 101 | 101 |
| 102 // Reads data from the given socket. | 102 // Reads data from the given socket. |
| 103 // |socketId| : The socketId. | 103 // |socketId| : The socketId. |
| 104 // |bufferSize| : The read buffer size. |
| 104 // |callback| : Delivers data that was available to be read without | 105 // |callback| : Delivers data that was available to be read without |
| 105 // blocking. | 106 // blocking. |
| 106 static void read(long socketId, | 107 static void read(long socketId, |
| 108 optional long bufferSize, |
| 107 ReadCallback callback); | 109 ReadCallback callback); |
| 108 | 110 |
| 109 // Writes data on the given socket. | 111 // Writes data on the given socket. |
| 110 // |socketId| : The socketId. | 112 // |socketId| : The socketId. |
| 111 // |data| : The data to write. Warning: will probably become a blob or other | 113 // |data| : The data to write. Warning: will probably become a blob or other |
| 112 // appropriate binary-friendly type. | 114 // appropriate binary-friendly type. |
| 113 // |callback| : Called when the first of any of the following happens: the | 115 // |callback| : Called when the first of any of the following happens: the |
| 114 // write operation completes without blocking, the write operation blocked | 116 // write operation completes without blocking, the write operation blocked |
| 115 // before completion (in which case onEvent() will eventually be called with | 117 // before completion (in which case onEvent() will eventually be called with |
| 116 // a <code>writeComplete</code> event), or an error occurred. | 118 // a <code>writeComplete</code> event), or an error occurred. |
| 117 // TODO(miket): [instanceOf=ArrayBuffer]object data; | 119 // TODO(miket): [instanceOf=ArrayBuffer]object data; |
| 118 static void write(long socketId, | 120 static void write(long socketId, |
| 119 long[] data, | 121 long[] data, |
| 120 WriteCallback callback); | 122 WriteCallback callback); |
| 121 | 123 |
| 122 // Reads data from the given socket. | 124 // Reads data from the given socket. |
| 123 // |socketId| : The socketId. | 125 // |socketId| : The socketId. |
| 126 // |bufferSize| : The receive buffer size. |
| 124 // |callback| : Delivers data that was available to be read without | 127 // |callback| : Delivers data that was available to be read without |
| 125 // blocking. | 128 // blocking. |
| 126 static void recvFrom(long socketId, | 129 static void recvFrom(long socketId, |
| 130 optional long bufferSize, |
| 127 RecvFromCallback callback); | 131 RecvFromCallback callback); |
| 128 | 132 |
| 129 // Writes data on the given socket. | 133 // Writes data on the given socket. |
| 130 // |socketId| : The socketId. | 134 // |socketId| : The socketId. |
| 131 // |data| : The data to write. Warning: will probably become a blob or other | 135 // |data| : The data to write. Warning: will probably become a blob or other |
| 132 // appropriate binary-friendly type. | 136 // appropriate binary-friendly type. |
| 133 // |address| : The address of the remote machine. | 137 // |address| : The address of the remote machine. |
| 134 // |port| : The port of the remote machine. | 138 // |port| : The port of the remote machine. |
| 135 // |callback| : Called when the first of any of the following happens: the | 139 // |callback| : Called when the first of any of the following happens: the |
| 136 // write operation completes without blocking, the write operation blocked | 140 // write operation completes without blocking, the write operation blocked |
| 137 // before completion (in which case onEvent() will eventually be called with | 141 // before completion (in which case onEvent() will eventually be called with |
| 138 // a <code>writeComplete</code> event), or an error occurred. | 142 // a <code>writeComplete</code> event), or an error occurred. |
| 139 static void sendTo(long socketId, | 143 static void sendTo(long socketId, |
| 140 long[] data, | 144 long[] data, |
| 141 DOMString address, | 145 DOMString address, |
| 142 long port, | 146 long port, |
| 143 SendToCallback callback); | 147 SendToCallback callback); |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 }; | 150 }; |
| OLD | NEW |