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

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

Issue 613683006: Add TCP socket mojo interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split it apart Created 6 years, 3 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_bound_socket.mojom
diff --git a/mojo/services/public/interfaces/network/tcp_bound_socket.mojom b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..0772846d502489f6d7db43878b09b073bffabe69
--- /dev/null
+++ b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom
@@ -0,0 +1,39 @@
+// 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"
+import "mojo/services/public/interfaces/network/tcp_server_socket.mojom"
+
+module mojo {
+
+// Represents a TCP socket that is bound to a local address and port, but
+// is not yet in a listening or connected state.
+//
+// A bound socket can be used to create a server socket listening on the
+// local address, or it can be used to create a client socket by connecting to
+// a remote host.
+interface TCPBoundSocket {
+ // Puts the socket into server mode, awaiting incoming connections.
+ //
+ // Once this function is called, neither StartListening nor Connect can be
+ // used on this socket again.
+ StartListening(TCPServerSocket& server);
yzshen1 2014/10/02 00:21:46 Does it need a callback reporting NetworkError?
brettw 2014/10/02 04:09:30 I'm going to do the implementation and see what we
+
+ // Puts this socket into client mode by connecting to a remote host. If you
+ // do not care about the local address or port, you can call
+ // NetworkService.CreateTCPClientSocket to connect directly and skip the
+ // "bound" state.
+ //
+ // Once this function is called, neither StartListening nor Connect can be
+ // used on this socket again.
+ Connect(NetAddress remote_address,
+ handle<data_pipe_consumer> send_stream,
+ handle<data_pipe_producer> receive_stream,
+ TCPClientSocket& client_socket)
+ => (NetworkError result);
+};
+
+}

Powered by Google App Engine
This is Rietveld 408576698