Chromium Code Reviews| Index: mojo/services/public/interfaces/network/tcp_server_socket.mojom |
| diff --git a/mojo/services/public/interfaces/network/tcp_server_socket.mojom b/mojo/services/public/interfaces/network/tcp_server_socket.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4b2e5966d611a827b2f3e4c7dc75eaf7649da247 |
| --- /dev/null |
| +++ b/mojo/services/public/interfaces/network/tcp_server_socket.mojom |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 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. |
| + |
| +import "mojo/services/public/interfaces/network/net_address.mojom" |
| +import "mojo/services/public/interfaces/network/network_error.mojom" |
| +import "mojo/services/public/interfaces/network/tcp_client_socket.mojom" |
| + |
| +module mojo { |
| + |
| +// Represents a TCP server socket listening for incoming requests. |
| +[Client=TCPServerSocketClient] |
| +interface TCPServerSocket { |
| + // Accepts an incoming connection request and hooks up a TCPClientSocket for |
| + // connecting with the remote host. This function is called in reponse to |
| + // OnConnectionAvailable(). |
| + // |
| + // On success, the address of the remote host will be provided. |
| + AcceptConnection(handle<data_pipe_consumer> send_stream, |
| + handle<data_pipe_producer> receive_stream, |
| + TCPClientSocket& client_socket) |
|
wtc
2014/10/03 22:37:43
Nit: it is confusing that TCPServerSocket::AcceptC
|
| + => (NetworkError result, NetAddress? remote_address); |
| +}; |
| + |
| +interface TCPServerSocketClient { |
| + // Notifies the client that an incoming connection is available. |
| + // |
| + // The client should call AcceptConnection() to accept the request. |
| + OnConnectionAvailable(); |
| + |
| + // TODO(brettw) probably need some error reporting function here. |
| +}; |
| + |
| +} |