Chromium Code Reviews| Index: ppapi/api/private/ppb_tcp_server_socket_private.idl |
| diff --git a/ppapi/api/private/ppb_tcp_server_socket_private.idl b/ppapi/api/private/ppb_tcp_server_socket_private.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8f2828505d64a1fd6df43476ba10a1cababaf8d2 |
| --- /dev/null |
| +++ b/ppapi/api/private/ppb_tcp_server_socket_private.idl |
| @@ -0,0 +1,63 @@ |
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/** |
| + * This file defines the <code>PPB_TCPServerSocket_Private</code> interface. |
| + */ |
| + |
| +label Chrome { |
| + M18 = 0.1 |
| +}; |
| + |
| +/** |
| + * The <code>PPB_TCPServerSocket_Private</code> interface provides TCP |
| + * server socket operations. |
| + */ |
| +interface PPB_TCPServerSocket_Private { |
| + /** |
| + * Allocates a TCP server socket resource and stores reference to it |
| + * in |tcp_server_socket|. |callback| is invoked when new |
| + * PPB_TCP_ServerSocket_Private is successfully created or in the |
| + * case of failure. |
| + */ |
| + int32_t Create([in] PP_Instance instance, |
| + [out] PP_Resource tcp_server_socket, |
| + [in] PP_CompletionCallback callback); |
|
brettw
2012/02/09 00:13:48
We don't use callbacks in "create" functions becau
ygorshenin1
2012/02/09 15:00:10
We decided that separate "Init" function will look
brettw
2012/02/09 18:19:11
I kind of know what you mean, but nothing else wor
ygorshenin1
2012/02/09 18:44:27
Well, but how to distinguish errors in socket init
brettw
2012/02/09 18:52:33
That's true. What errors are you concerned about d
ygorshenin1
2012/02/09 19:13:07
New socket can't be initialized if socket table is
ygorshenin1
2012/02/10 13:27:40
Done.
|
| + |
| + /** |
| + * Determines if a given resource is TCP server socket. |
| + */ |
| + PP_Bool IsTCPServerSocket([in] PP_Resource resource); |
| + |
| + /** |
| + * Binds |tcp_server_socket| to the address given by |addr| and |
| + * starts listening. The |backlog| argument defines the maximum |
| + * length to which the queue of pending connections may |
| + * grow. |callback| is invoked when |tcp_server_socket| is ready to |
| + * accept incoming connections or in the case of failure. |
| + */ |
| + int32_t Listen([in] PP_Resource tcp_server_socket, |
| + [in] PP_NetAddress_Private addr, |
| + [in] int32_t backlog, |
| + [in] PP_CompletionCallback callback); |
| + |
| + /** |
| + * Accepts single connection, creates instance of |
| + * PPB_TCPSocket_Private and stores reference to it in |
| + * |tcp_socket|. |callback| is invoked when connection is accepted |
| + * or in the case of failure. This method can be called only after |
| + * succesfull Listen call on |tcp_server_socket|. |
| + */ |
| + int32_t Accept([in] PP_Resource tcp_server_socket, |
| + [out] PP_Resource tcp_socket, |
| + [in] PP_CompletionCallback callback); |
| + |
| + /** |
| + * Cancels all pending callbacks reporting PP_Error_Aborted and |
|
yzshen1
2012/02/09 02:31:50
PP_ERROR_ABORTED, please.
ygorshenin1
2012/02/09 15:00:10
Done.
|
| + * closes the socket. Note: this method is implicitly called when |
| + * server socket is destroyed. |
| + */ |
| + void StopListening([in] PP_Resource tcp_server_socket); |
| +}; |