Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1888)

Unified Diff: mojo/services/public/interfaces/network/tcp_server_socket.mojom

Issue 613683006: Add TCP socket mojo interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement network service functions Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
+};
+
+}

Powered by Google App Engine
This is Rietveld 408576698