OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ | |
6 #define PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ | |
7 | |
8 #include "ppapi/c/pp_bool.h" | |
9 #include "ppapi/c/pp_completion_callback.h" | |
10 #include "ppapi/c/pp_instance.h" | |
11 #include "ppapi/c/pp_resource.h" | |
12 #include "ppapi/c/pp_stdint.h" | |
13 #include "ppapi/c/private/ppb_flash_tcp_socket.h" // for PP_Flash_NetAddress | |
14 | |
15 #define PPB_FLASH_UDPSOCKET_INTERFACE "PPB_Flash_UDPSocket;0.1" | |
16 | |
17 struct PPB_Flash_UDPSocket { | |
18 PP_Resource (*Create)(PP_Instance instance, | |
19 int32_t family); | |
yzshen1
2011/09/07 18:00:36
Style: the parameters could fit in one line.
mtilburg
2011/09/15 23:13:32
Done.
| |
20 | |
yzshen1
2011/09/07 18:00:36
I think you probably need such a function
PP_Bool
mtilburg
2011/09/15 23:13:32
Done.
| |
21 // creates a socket and binds to the address given by |addr|. | |
yzshen1
2011/09/07 18:00:36
Please use sentence, starting with a capital lette
mtilburg
2011/09/15 23:13:32
Done.
| |
22 int32_t (*Bind)(PP_Resource udp_socket, | |
23 const struct PP_Flash_NetAddress* addr, | |
yzshen1
2011/09/07 18:00:36
Have you considered using host + port?
Currently P
mtilburg
2011/09/15 23:13:32
I started a conversation with Trung about this...
| |
24 struct PP_CompletionCallback callback); | |
25 | |
26 // non-blocking recvfrom call on socket. must call Bind first, |callback| is | |
27 // invoked with recvfrom reads data | |
28 int32_t (*RecvFrom)(PP_Resource udp_socket, | |
29 char* buffer, | |
30 int32_t num_bytes, | |
31 const struct PP_Flash_NetAddress* addr, | |
32 struct PP_CompletionCallback callback); | |
33 | |
34 // upon successful completion of RecvFrom, the address that the data | |
35 // was received from is stored in |addr| | |
36 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, | |
yzshen1
2011/09/07 18:00:36
What is the relationship between this |addr| and t
mtilburg
2011/09/15 23:13:32
I removed the one from RecvFrom, which was actuall
| |
37 struct PP_Flash_NetAddress* addr); | |
38 | |
39 // non-blocking sendto call on socket. must call Bind first, |callback| is | |
40 // invoked when sendto completes | |
41 int32_t (*SendTo)(PP_Resource udp_socket, | |
42 const char* buffer, | |
43 int32_t num_bytes, | |
44 const struct PP_Flash_NetAddress* addr, | |
45 struct PP_CompletionCallback callback); | |
46 | |
47 // Cancels all pending reads and writes, and closes the socket. | |
48 void (*Disconnect)(PP_Resource udp_socket); | |
49 }; | |
50 | |
51 #endif // PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ | |
OLD | NEW |