OLD | NEW |
1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 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 | 5 |
6 /** | 6 /** |
7 * This file defines the <code>PPB_UDPSocket</code> interface. | 7 * This file defines the <code>PPB_UDPSocket</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 * Specifies the total per-socket buffer space reserved for receives. Value's | 49 * Specifies the total per-socket buffer space reserved for receives. Value's |
50 * type should be <code>PP_VARTYPE_INT32</code>. | 50 * type should be <code>PP_VARTYPE_INT32</code>. |
51 * On version 1.0, this option can only be set after a successful | 51 * On version 1.0, this option can only be set after a successful |
52 * <code>Bind()</code> call. On version 1.1 or later, there is no such | 52 * <code>Bind()</code> call. On version 1.1 or later, there is no such |
53 * limitation. | 53 * limitation. |
54 * | 54 * |
55 * Note: This is only treated as a hint for the browser to set the buffer | 55 * Note: This is only treated as a hint for the browser to set the buffer |
56 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't | 56 * size. Even if <code>SetOption()</code> succeeds, the browser doesn't |
57 * guarantee it will conform to the size. | 57 * guarantee it will conform to the size. |
58 */ | 58 */ |
59 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3 | 59 PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE = 3, |
| 60 |
| 61 /** |
| 62 * Specifies whether the packets sent from the host to the multicast group |
| 63 * should be looped back to the host or not. Value's type should be |
| 64 * <code>PP_VARTYPE_BOOL</code>. |
| 65 * This option can only be set before calling <code>Bind()</code>. |
| 66 * |
| 67 * This is only supported in version 1.1 of the API (Chrome 41) and later. |
| 68 */ |
| 69 [version=1.1] |
| 70 PP_UDPSOCKET_OPTION_MULTICAST_LOOP = 4, |
| 71 |
| 72 /** |
| 73 * Specifies the time-to-live for packets sent to the multicast group. The |
| 74 * value should be within 0 to 255 range. The default value is 1 and means |
| 75 * that packets will not be routed beyond the local network. Value's type |
| 76 * should be <code>PP_VARTYPE_INT32</code>. |
| 77 * This option can only be set before calling <code>Bind()</code>. |
| 78 * |
| 79 * This is only supported in version 1.1 of the API (Chrome 41) and later. |
| 80 */ |
| 81 [version=1.1] |
| 82 PP_UDPSOCKET_OPTION_MULTICAST_TTL = 5, |
| 83 |
| 84 /** |
| 85 * Specifies the network interface from which the multicast packets will be |
| 86 * sent and received, as specified by <code>PPB_NetworkList</code>. Value's |
| 87 * type should be <code>PP_VARTYPE_INT32</code>. |
| 88 * This option can only be set before calling <code>Bind()</code>. |
| 89 * |
| 90 * This is only supported in version 1.1 of the API (Chrome 41) and later. |
| 91 */ |
| 92 [version=1.1] |
| 93 PP_UDPSOCKET_OPTION_MULTICAST_IF = 6, |
| 94 |
| 95 /** |
| 96 * Joins the multicast group with given address as specifed by |
| 97 * <code>PPB_NetAddress</code> API. Value's type should be |
| 98 * <code>PP_VARTYPE_RESOURCE</code>. |
| 99 * This option can only be set after a successful <code>Bind()</code> call. |
| 100 * |
| 101 * This is only supported in version 1.1 of the API (Chrome 41) and later. |
| 102 */ |
| 103 [version=1.1] |
| 104 PP_UDPSOCKET_OPTION_MULTICAST_JOIN = 7, |
| 105 |
| 106 /** |
| 107 * Leaves the multicast group with given address as specifed by |
| 108 * <code>PPB_NetAddress</code> API. Value's type should be |
| 109 * <code>PP_VARTYPE_RESOURCE</code>. |
| 110 * This option can only be set after a successful <code>Bind()</code> call. |
| 111 * |
| 112 * This is only supported in version 1.1 of the API (Chrome 41) and later. |
| 113 */ |
| 114 [version=1.1] |
| 115 PP_UDPSOCKET_OPTION_MULTICAST_LEAVE = 8 |
60 }; | 116 }; |
61 | 117 |
62 /** | 118 /** |
63 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. | 119 * The <code>PPB_UDPSocket</code> interface provides UDP socket operations. |
64 * | 120 * |
65 * Permissions: Apps permission <code>socket</code> with subrule | 121 * Permissions: Apps permission <code>socket</code> with subrule |
66 * <code>udp-bind</code> is required for <code>Bind()</code>; subrule | 122 * <code>udp-bind</code> is required for <code>Bind()</code>; subrule |
67 * <code>udp-send-to</code> is required for <code>SendTo()</code>. | 123 * <code>udp-send-to</code> is required for <code>SendTo()</code>. |
68 * For more details about network communication permissions, please see: | 124 * For more details about network communication permissions, please see: |
69 * http://developer.chrome.com/apps/app_network.html | 125 * http://developer.chrome.com/apps/app_network.html |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 * completion. | 267 * completion. |
212 * | 268 * |
213 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 269 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
214 */ | 270 */ |
215 [version=1.1] | 271 [version=1.1] |
216 int32_t SetOption([in] PP_Resource udp_socket, | 272 int32_t SetOption([in] PP_Resource udp_socket, |
217 [in] PP_UDPSocket_Option name, | 273 [in] PP_UDPSocket_Option name, |
218 [in] PP_Var value, | 274 [in] PP_Var value, |
219 [in] PP_CompletionCallback callback); | 275 [in] PP_CompletionCallback callback); |
220 }; | 276 }; |
OLD | NEW |