| OLD | NEW |
| (Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From private/ppb_tcp_server_socket_private.idl, |
| 7 * modified Tue Jan 24 15:01:18 2012. |
| 8 */ |
| 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPB_TCP_SERVER_SOCKET_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPB_TCP_SERVER_SOCKET_PRIVATE_H_ |
| 12 |
| 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_completion_callback.h" |
| 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/c/pp_macros.h" |
| 17 #include "ppapi/c/pp_resource.h" |
| 18 #include "ppapi/c/pp_stdint.h" |
| 19 #include "ppapi/c/private/ppb_net_address_private.h" |
| 20 |
| 21 #define PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE_0_1 \ |
| 22 "PPB_TCPServerSocket_Private;0.1" |
| 23 #define PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE \ |
| 24 PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE_0_1 |
| 25 |
| 26 /** |
| 27 * @file |
| 28 * This file defines the <code>PPB_TCPServerSocket_Private</code> interface. |
| 29 */ |
| 30 |
| 31 |
| 32 /** |
| 33 * @addtogroup Interfaces |
| 34 * @{ |
| 35 */ |
| 36 /** |
| 37 * The <code>PPB_TCPServerSocket_Private</code> interface provides TCP |
| 38 * server socket operations. |
| 39 */ |
| 40 struct PPB_TCPServerSocket_Private_0_1 { |
| 41 /** |
| 42 * Allocates a TCP server socket resource. |
| 43 */ |
| 44 PP_Resource (*Create)(PP_Instance instance); |
| 45 /** |
| 46 * Determines if a given resource is TCP server socket. |
| 47 */ |
| 48 PP_Bool (*IsTCPServerSocket)(PP_Resource resource); |
| 49 /** |
| 50 * Binds the socket and starts listening. |
| 51 */ |
| 52 int32_t (*Listen)(PP_Resource tcp_server_socket, |
| 53 const struct PP_NetAddress_Private* addr, |
| 54 int32_t backlog, |
| 55 struct PP_CompletionCallback callback); |
| 56 /** |
| 57 * Accept connection. Callback is called when new connection is |
| 58 * accepted. |
| 59 */ |
| 60 int32_t (*Accept)(PP_Resource tcp_server_socket, |
| 61 PP_Resource* tcp_socket, |
| 62 struct PP_CompletionCallback callback); |
| 63 /** |
| 64 * Cancels all pending callbacks reporting PP_Error_Aborted and |
| 65 * closes the socket. Note: this method is implicitly called when |
| 66 * server socket is destroyed. |
| 67 */ |
| 68 void (*StopListening)(PP_Resource tcp_server_socket); |
| 69 }; |
| 70 |
| 71 typedef struct PPB_TCPServerSocket_Private_0_1 PPB_TCPServerSocket_Private; |
| 72 /** |
| 73 * @} |
| 74 */ |
| 75 |
| 76 #endif /* PPAPI_C_PRIVATE_PPB_TCP_SERVER_SOCKET_PRIVATE_H_ */ |
| 77 |
| OLD | NEW |