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. | |
| 21 */ | |
| 22 PP_Resource Create([in] PP_Instance instance); | |
| 23 | |
| 24 /** | |
| 25 * Determines if a given resource is TCP server socket. | |
| 26 */ | |
| 27 PP_Bool IsTCPServerSocket([in] PP_Resource resource); | |
| 28 | |
| 29 /** | |
| 30 * Binds |tcp_server_socket| to the address given by |addr| and | |
| 31 * starts listening. The |backlog| argument defines the maximum | |
| 32 * length to which the queue of pending connections may | |
| 33 * grow. |callback| is invoked when |tcp_server_socket| is ready to | |
| 34 * accept incoming connections or in the case of failure. Returns | |
| 35 * PP_ERROR_NOSPACE socket if the socket table is full, or | |
|
yzshen1
2012/02/14 00:42:04
Please remove the first 'socket'.
nit: 'socket ta
ygorshenin1
2012/02/14 09:34:44
Done.
| |
| 36 * PP_ERROR_FAILED in the case of Listen failure. Otherwise, returns | |
| 37 * PP_OK. | |
| 38 */ | |
| 39 int32_t Listen([in] PP_Resource tcp_server_socket, | |
| 40 [in] PP_NetAddress_Private addr, | |
| 41 [in] int32_t backlog, | |
| 42 [in] PP_CompletionCallback callback); | |
| 43 | |
| 44 /** | |
| 45 * Accepts single connection, creates instance of | |
| 46 * PPB_TCPSocket_Private and stores reference to it in | |
| 47 * |tcp_socket|. |callback| is invoked when connection is accepted | |
| 48 * or in the case of failure. This method can be called only after | |
| 49 * succesfull Listen call on |tcp_server_socket|. | |
| 50 */ | |
| 51 int32_t Accept([in] PP_Resource tcp_server_socket, | |
| 52 [out] PP_Resource tcp_socket, | |
| 53 [in] PP_CompletionCallback callback); | |
| 54 | |
| 55 /** | |
| 56 * Cancels all pending callbacks reporting PP_ERROR_ABORTED and | |
| 57 * closes the socket. Note: this method is implicitly called when | |
| 58 * server socket is destroyed. | |
| 59 */ | |
| 60 void StopListening([in] PP_Resource tcp_server_socket); | |
| 61 }; | |
| OLD | NEW |