OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 module mojo; |
| 6 |
5 import "mojo/services/public/interfaces/network/net_address.mojom"; | 7 import "mojo/services/public/interfaces/network/net_address.mojom"; |
6 import "mojo/services/public/interfaces/network/network_error.mojom"; | 8 import "mojo/services/public/interfaces/network/network_error.mojom"; |
7 import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"; | 9 import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"; |
8 | 10 |
9 module mojo { | |
10 | |
11 // Represents a TCP server socket listening for incoming requests. | 11 // Represents a TCP server socket listening for incoming requests. |
12 interface TCPServerSocket { | 12 interface TCPServerSocket { |
13 // Waits for an incoming connection request and hooks up a TCPConnectedSocket | 13 // Waits for an incoming connection request and hooks up a TCPConnectedSocket |
14 // for connecting with the remote host. Only one Accept call can be pending | 14 // for connecting with the remote host. Only one Accept call can be pending |
15 // at a time. | 15 // at a time. |
16 // | 16 // |
17 // Once a connection has been established (indicated by a successful | 17 // Once a connection has been established (indicated by a successful |
18 // callback), the TCPConnectedSocket may outlive the TCPServerSocket that | 18 // callback), the TCPConnectedSocket may outlive the TCPServerSocket that |
19 // created it. | 19 // created it. |
20 // | 20 // |
21 // On success, the address of the remote host will be provided. | 21 // On success, the address of the remote host will be provided. |
22 Accept(handle<data_pipe_consumer> send_stream, | 22 Accept(handle<data_pipe_consumer> send_stream, |
23 handle<data_pipe_producer> receive_stream, | 23 handle<data_pipe_producer> receive_stream, |
24 TCPConnectedSocket& client_socket) | 24 TCPConnectedSocket& client_socket) |
25 => (NetworkError result, NetAddress? remote_address); | 25 => (NetworkError result, NetAddress? remote_address); |
26 }; | 26 }; |
27 | |
28 } | |
OLD | NEW |