| 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 #ifndef PPAPI_CPP_UDP_SOCKET_H_ | 5 #ifndef PPAPI_CPP_UDP_SOCKET_H_ |
| 6 #define PPAPI_CPP_UDP_SOCKET_H_ | 6 #define PPAPI_CPP_UDP_SOCKET_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_udp_socket.h" | 8 #include "ppapi/c/ppb_udp_socket.h" |
| 9 #include "ppapi/cpp/net_address.h" | 9 #include "ppapi/cpp/net_address.h" |
| 10 #include "ppapi/cpp/pass_ref.h" | 10 #include "ppapi/cpp/pass_ref.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 /// @param[in] num_bytes The number of bytes to send. | 118 /// @param[in] num_bytes The number of bytes to send. |
| 119 /// @param[in] addr A <code>NetAddress</code> object holding the destination | 119 /// @param[in] addr A <code>NetAddress</code> object holding the destination |
| 120 /// address. | 120 /// address. |
| 121 /// @param[in] callback A <code>CompletionCallback</code> to be called upon | 121 /// @param[in] callback A <code>CompletionCallback</code> to be called upon |
| 122 /// completion. | 122 /// completion. |
| 123 /// | 123 /// |
| 124 /// @return A non-negative number on success to indicate how many bytes have | 124 /// @return A non-negative number on success to indicate how many bytes have |
| 125 /// been sent; otherwise, an error code from <code>pp_errors.h</code>. | 125 /// been sent; otherwise, an error code from <code>pp_errors.h</code>. |
| 126 /// <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have | 126 /// <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have |
| 127 /// required permissions. | 127 /// required permissions. |
| 128 /// <code>PP_ERROR_INPROGRESS</code> will be returned if the socket is busy |
| 129 /// sending. The caller should wait until a pending send completes before |
| 130 /// retrying. |
| 128 int32_t SendTo(const char* buffer, | 131 int32_t SendTo(const char* buffer, |
| 129 int32_t num_bytes, | 132 int32_t num_bytes, |
| 130 const NetAddress& addr, | 133 const NetAddress& addr, |
| 131 const CompletionCallback& callback); | 134 const CompletionCallback& callback); |
| 132 | 135 |
| 133 /// Cancels all pending reads and writes, and closes the socket. Any pending | 136 /// Cancels all pending reads and writes, and closes the socket. Any pending |
| 134 /// callbacks will still run, reporting <code>PP_ERROR_ABORTED</code> if | 137 /// callbacks will still run, reporting <code>PP_ERROR_ABORTED</code> if |
| 135 /// pending IO was interrupted. After a call to this method, no output | 138 /// pending IO was interrupted. After a call to this method, no output |
| 136 /// paramters passed into previous <code>RecvFrom()</code> calls will be | 139 /// paramters passed into previous <code>RecvFrom()</code> calls will be |
| 137 /// accessed. It is not valid to call <code>Bind()</code> again. | 140 /// accessed. It is not valid to call <code>Bind()</code> again. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 151 /// | 154 /// |
| 152 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 155 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 153 int32_t SetOption(PP_UDPSocket_Option name, | 156 int32_t SetOption(PP_UDPSocket_Option name, |
| 154 const Var& value, | 157 const Var& value, |
| 155 const CompletionCallback& callback); | 158 const CompletionCallback& callback); |
| 156 }; | 159 }; |
| 157 | 160 |
| 158 } // namespace pp | 161 } // namespace pp |
| 159 | 162 |
| 160 #endif // PPAPI_CPP_UDP_SOCKET_H_ | 163 #endif // PPAPI_CPP_UDP_SOCKET_H_ |
| OLD | NEW |