Chromium Code Reviews| 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 /** | |
| 7 * This file defines the <code>PPB_TCPServerSocket_Private</code> interface. | |
| 8 */ | |
| 9 | |
| 10 label Chrome { | |
| 11 M18 = 0.1 | |
| 12 }; | |
| 13 | |
| 14 /** | |
| 15 * The <code>PPB_TCPServerSocket_Private</code> interface provides TCP | |
| 16 * server socket operations. | |
| 17 */ | |
| 18 interface PPB_TCPServerSocket_Private { | |
| 19 /** | |
| 20 * Allocates a TCP server socket resource and stores reference to it | |
| 21 * in |tcp_server_socket|. |callback| is invoked when new | |
| 22 * PPB_TCP_ServerSocket_Private is successfully created or in the | |
| 23 * case of failure. | |
| 24 */ | |
| 25 int32_t Create([in] PP_Instance instance, | |
| 26 [out] PP_Resource tcp_server_socket, | |
| 27 [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.
| |
| 28 | |
| 29 /** | |
| 30 * Determines if a given resource is TCP server socket. | |
| 31 */ | |
| 32 PP_Bool IsTCPServerSocket([in] PP_Resource resource); | |
| 33 | |
| 34 /** | |
| 35 * Binds |tcp_server_socket| to the address given by |addr| and | |
| 36 * starts listening. The |backlog| argument defines the maximum | |
| 37 * length to which the queue of pending connections may | |
| 38 * grow. |callback| is invoked when |tcp_server_socket| is ready to | |
| 39 * accept incoming connections or in the case of failure. | |
| 40 */ | |
| 41 int32_t Listen([in] PP_Resource tcp_server_socket, | |
| 42 [in] PP_NetAddress_Private addr, | |
| 43 [in] int32_t backlog, | |
| 44 [in] PP_CompletionCallback callback); | |
| 45 | |
| 46 /** | |
| 47 * Accepts single connection, creates instance of | |
| 48 * PPB_TCPSocket_Private and stores reference to it in | |
| 49 * |tcp_socket|. |callback| is invoked when connection is accepted | |
| 50 * or in the case of failure. This method can be called only after | |
| 51 * succesfull Listen call on |tcp_server_socket|. | |
| 52 */ | |
| 53 int32_t Accept([in] PP_Resource tcp_server_socket, | |
| 54 [out] PP_Resource tcp_socket, | |
| 55 [in] PP_CompletionCallback callback); | |
| 56 | |
| 57 /** | |
| 58 * 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.
| |
| 59 * closes the socket. Note: this method is implicitly called when | |
| 60 * server socket is destroyed. | |
| 61 */ | |
| 62 void StopListening([in] PP_Resource tcp_server_socket); | |
| 63 }; | |
| OLD | NEW |