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_TCPSocket_Dev</code> interface. | 7 * This file defines the <code>PPB_TCPSocket_Dev</code> interface. |
8 */ | 8 */ |
9 | 9 |
10 [generate_thunk] | 10 [generate_thunk] |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 * <code>PPB_TCPSocket_Dev</code> resource; <code>PP_FALSE</code> | 77 * <code>PPB_TCPSocket_Dev</code> resource; <code>PP_FALSE</code> |
78 * otherwise. | 78 * otherwise. |
79 */ | 79 */ |
80 PP_Bool IsTCPSocket([in] PP_Resource resource); | 80 PP_Bool IsTCPSocket([in] PP_Resource resource); |
81 | 81 |
82 /** | 82 /** |
83 * Connects the socket to the given address. | 83 * Connects the socket to the given address. |
84 * | 84 * |
85 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 85 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
86 * socket. | 86 * socket. |
87 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource. | 87 * @param[in] addr A <code>PPB_NetAddress</code> resource. |
88 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 88 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
89 * completion. | 89 * completion. |
90 * | 90 * |
91 * @return An int32_t containing an error code from <code>pp_errors.h</code>, | 91 * @return An int32_t containing an error code from <code>pp_errors.h</code>, |
92 * including (but not limited to): | 92 * including (but not limited to): |
93 * - <code>PP_ERROR_NOACCESS</code>: the caller doesn't have required | 93 * - <code>PP_ERROR_NOACCESS</code>: the caller doesn't have required |
94 * permissions. | 94 * permissions. |
95 * - <code>PP_ERROR_ADDRESS_UNREACHABLE</code>: <code>addr</code> is | 95 * - <code>PP_ERROR_ADDRESS_UNREACHABLE</code>: <code>addr</code> is |
96 * unreachable. | 96 * unreachable. |
97 * - <code>PP_ERROR_CONNECTION_REFUSED</code>: the connection attempt was | 97 * - <code>PP_ERROR_CONNECTION_REFUSED</code>: the connection attempt was |
98 * refused. | 98 * refused. |
99 * - <code>PP_ERROR_CONNECTION_FAILED</code>: the connection attempt failed. | 99 * - <code>PP_ERROR_CONNECTION_FAILED</code>: the connection attempt failed. |
100 * - <code>PP_ERROR_CONNECTION_TIMEDOUT</code>: the connection attempt timed | 100 * - <code>PP_ERROR_CONNECTION_TIMEDOUT</code>: the connection attempt timed |
101 * out. | 101 * out. |
102 */ | 102 */ |
103 int32_t Connect([in] PP_Resource tcp_socket, | 103 int32_t Connect([in] PP_Resource tcp_socket, |
104 [in] PP_Resource addr, | 104 [in] PP_Resource addr, |
105 [in] PP_CompletionCallback callback); | 105 [in] PP_CompletionCallback callback); |
106 | 106 |
107 /** | 107 /** |
108 * Gets the local address of the socket, if it is connected. | 108 * Gets the local address of the socket, if it is connected. |
109 * | 109 * |
110 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 110 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
111 * socket. | 111 * socket. |
112 * | 112 * |
113 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 113 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
114 * failure. | |
115 */ | 114 */ |
116 PP_Resource GetLocalAddress([in] PP_Resource tcp_socket); | 115 PP_Resource GetLocalAddress([in] PP_Resource tcp_socket); |
117 | 116 |
118 /** | 117 /** |
119 * Gets the remote address of the socket, if it is connected. | 118 * Gets the remote address of the socket, if it is connected. |
120 * | 119 * |
121 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 120 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
122 * socket. | 121 * socket. |
123 * | 122 * |
124 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 123 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
125 * failure. | |
126 */ | 124 */ |
127 PP_Resource GetRemoteAddress([in] PP_Resource tcp_socket); | 125 PP_Resource GetRemoteAddress([in] PP_Resource tcp_socket); |
128 | 126 |
129 /** | 127 /** |
130 * Reads data from the socket. The socket must be connected. It may perform a | 128 * Reads data from the socket. The socket must be connected. It may perform a |
131 * partial read. | 129 * partial read. |
132 * | 130 * |
133 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 131 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
134 * socket. | 132 * socket. |
135 * @param[out] buffer The buffer to store the received data on success. It | 133 * @param[out] buffer The buffer to store the received data on success. It |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 191 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
194 * completion. | 192 * completion. |
195 * | 193 * |
196 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 194 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
197 */ | 195 */ |
198 int32_t SetOption([in] PP_Resource tcp_socket, | 196 int32_t SetOption([in] PP_Resource tcp_socket, |
199 [in] PP_TCPSocket_Option_Dev name, | 197 [in] PP_TCPSocket_Option_Dev name, |
200 [in] PP_Var value, | 198 [in] PP_Var value, |
201 [in] PP_CompletionCallback callback); | 199 [in] PP_CompletionCallback callback); |
202 }; | 200 }; |
OLD | NEW |