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 | 5 |
6 /* From private/ppb_udp_socket_private.idl modified Wed Nov 16 15:27:20 2011. */ | 6 /* From private/ppb_udp_socket_private.idl modified Wed Nov 16 15:27:20 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ |
9 #define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ | 9 #define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 */ | 31 */ |
32 struct PPB_UDPSocket_Private_0_2 { | 32 struct PPB_UDPSocket_Private_0_2 { |
33 /** | 33 /** |
34 * Creates a UDP socket resource. | 34 * Creates a UDP socket resource. |
35 */ | 35 */ |
36 PP_Resource (*Create)(PP_Instance instance_id); | 36 PP_Resource (*Create)(PP_Instance instance_id); |
37 /** | 37 /** |
38 * Determines if a given resource is a UDP socket. | 38 * Determines if a given resource is a UDP socket. |
39 */ | 39 */ |
40 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); | 40 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); |
41 /* Creates a socket and binds to the address given by |addr|. */ | 41 /* Creates a socket and binds to the address given by |addr|. |
| 42 * Returns the port number that the socket is bound to on |
| 43 * success, 0 on failure |
| 44 */ |
42 int32_t (*Bind)(PP_Resource udp_socket, | 45 int32_t (*Bind)(PP_Resource udp_socket, |
43 const struct PP_NetAddress_Private* addr, | 46 const struct PP_NetAddress_Private* addr, |
44 struct PP_CompletionCallback callback); | 47 struct PP_CompletionCallback callback); |
45 /* Performs a non-blocking recvfrom call on socket. | 48 /* Performs a non-blocking recvfrom call on socket. |
46 * Bind must be called first. |callback| is invoked when recvfrom | 49 * Bind must be called first. |callback| is invoked when recvfrom |
47 * reads data. You must call GetRecvFromAddress to recover the | 50 * reads data. You must call GetRecvFromAddress to recover the |
48 * address the data was retrieved from. | 51 * address the data was retrieved from. |
49 */ | 52 */ |
50 int32_t (*RecvFrom)(PP_Resource udp_socket, | 53 int32_t (*RecvFrom)(PP_Resource udp_socket, |
51 char* buffer, | 54 char* buffer, |
(...skipping 17 matching lines...) Expand all Loading... |
69 void (*Close)(PP_Resource udp_socket); | 72 void (*Close)(PP_Resource udp_socket); |
70 }; | 73 }; |
71 | 74 |
72 typedef struct PPB_UDPSocket_Private_0_2 PPB_UDPSocket_Private; | 75 typedef struct PPB_UDPSocket_Private_0_2 PPB_UDPSocket_Private; |
73 /** | 76 /** |
74 * @} | 77 * @} |
75 */ | 78 */ |
76 | 79 |
77 #endif /* PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ */ | 80 #endif /* PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ */ |
78 | 81 |
OLD | NEW |