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 /* From dev/ppb_tcp_socket_dev.idl modified Thu Jun 20 15:14:26 2013. */ | 6 /* From dev/ppb_tcp_socket_dev.idl modified Thu Jun 20 15:14:26 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 * @return <code>PP_TRUE</code> if the input is a | 96 * @return <code>PP_TRUE</code> if the input is a |
97 * <code>PPB_TCPSocket_Dev</code> resource; <code>PP_FALSE</code> | 97 * <code>PPB_TCPSocket_Dev</code> resource; <code>PP_FALSE</code> |
98 * otherwise. | 98 * otherwise. |
99 */ | 99 */ |
100 PP_Bool (*IsTCPSocket)(PP_Resource resource); | 100 PP_Bool (*IsTCPSocket)(PP_Resource resource); |
101 /** | 101 /** |
102 * Connects the socket to the given address. | 102 * Connects the socket to the given address. |
103 * | 103 * |
104 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 104 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
105 * socket. | 105 * socket. |
106 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource. | 106 * @param[in] addr A <code>PPB_NetAddress</code> resource. |
107 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 107 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
108 * completion. | 108 * completion. |
109 * | 109 * |
110 * @return An int32_t containing an error code from <code>pp_errors.h</code>, | 110 * @return An int32_t containing an error code from <code>pp_errors.h</code>, |
111 * including (but not limited to): | 111 * including (but not limited to): |
112 * - <code>PP_ERROR_NOACCESS</code>: the caller doesn't have required | 112 * - <code>PP_ERROR_NOACCESS</code>: the caller doesn't have required |
113 * permissions. | 113 * permissions. |
114 * - <code>PP_ERROR_ADDRESS_UNREACHABLE</code>: <code>addr</code> is | 114 * - <code>PP_ERROR_ADDRESS_UNREACHABLE</code>: <code>addr</code> is |
115 * unreachable. | 115 * unreachable. |
116 * - <code>PP_ERROR_CONNECTION_REFUSED</code>: the connection attempt was | 116 * - <code>PP_ERROR_CONNECTION_REFUSED</code>: the connection attempt was |
117 * refused. | 117 * refused. |
118 * - <code>PP_ERROR_CONNECTION_FAILED</code>: the connection attempt failed. | 118 * - <code>PP_ERROR_CONNECTION_FAILED</code>: the connection attempt failed. |
119 * - <code>PP_ERROR_CONNECTION_TIMEDOUT</code>: the connection attempt timed | 119 * - <code>PP_ERROR_CONNECTION_TIMEDOUT</code>: the connection attempt timed |
120 * out. | 120 * out. |
121 */ | 121 */ |
122 int32_t (*Connect)(PP_Resource tcp_socket, | 122 int32_t (*Connect)(PP_Resource tcp_socket, |
123 PP_Resource addr, | 123 PP_Resource addr, |
124 struct PP_CompletionCallback callback); | 124 struct PP_CompletionCallback callback); |
125 /** | 125 /** |
126 * Gets the local address of the socket, if it is connected. | 126 * Gets the local address of the socket, if it is connected. |
127 * | 127 * |
128 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 128 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
129 * socket. | 129 * socket. |
130 * | 130 * |
131 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 131 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
132 * failure. | |
133 */ | 132 */ |
134 PP_Resource (*GetLocalAddress)(PP_Resource tcp_socket); | 133 PP_Resource (*GetLocalAddress)(PP_Resource tcp_socket); |
135 /** | 134 /** |
136 * Gets the remote address of the socket, if it is connected. | 135 * Gets the remote address of the socket, if it is connected. |
137 * | 136 * |
138 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 137 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
139 * socket. | 138 * socket. |
140 * | 139 * |
141 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 140 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
142 * failure. | |
143 */ | 141 */ |
144 PP_Resource (*GetRemoteAddress)(PP_Resource tcp_socket); | 142 PP_Resource (*GetRemoteAddress)(PP_Resource tcp_socket); |
145 /** | 143 /** |
146 * Reads data from the socket. The socket must be connected. It may perform a | 144 * Reads data from the socket. The socket must be connected. It may perform a |
147 * partial read. | 145 * partial read. |
148 * | 146 * |
149 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP | 147 * @param[in] tcp_socket A <code>PP_Resource</code> corresponding to a TCP |
150 * socket. | 148 * socket. |
151 * @param[out] buffer The buffer to store the received data on success. It | 149 * @param[out] buffer The buffer to store the received data on success. It |
152 * must be at least as large as <code>bytes_to_read</code>. | 150 * must be at least as large as <code>bytes_to_read</code>. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 struct PP_CompletionCallback callback); | 212 struct PP_CompletionCallback callback); |
215 }; | 213 }; |
216 | 214 |
217 typedef struct PPB_TCPSocket_Dev_0_1 PPB_TCPSocket_Dev; | 215 typedef struct PPB_TCPSocket_Dev_0_1 PPB_TCPSocket_Dev; |
218 /** | 216 /** |
219 * @} | 217 * @} |
220 */ | 218 */ |
221 | 219 |
222 #endif /* PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ */ | 220 #endif /* PPAPI_C_DEV_PPB_TCP_SOCKET_DEV_H_ */ |
223 | 221 |
OLD | NEW |