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

Unified Diff: net/socket/tcp_server_socket.cc

Issue 2815993002: Adds a method to TCPServerSocket to adopt a socket. (Closed)
Patch Set: Fixed (I hope) Windows compile failure. Created 3 years, 8 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: net/socket/tcp_server_socket.cc
diff --git a/net/socket/tcp_server_socket.cc b/net/socket/tcp_server_socket.cc
index 22211cd9496626e62c194ebf0ea82391ca5e3cb1..4778ba3df10d7cf433ccbad4cabd0275a0f70a6f 100644
--- a/net/socket/tcp_server_socket.cc
+++ b/net/socket/tcp_server_socket.cc
@@ -17,6 +17,14 @@ namespace net {
TCPServerSocket::TCPServerSocket(NetLog* net_log, const NetLogSource& source)
: socket_(nullptr, net_log, source), pending_accept_(false) {}
+#if defined(OS_POSIX)
+int TCPServerSocket::AdopListeningRawSocket(int socket_fd) {
+ // A TCPSocketPosix can adopt any socket, whether connected or not, so the
+ // following method is a slight misnomer.
+ return socket_.AdoptConnectedSocket(socket_fd, IPEndPoint());
mmenke 2017/04/17 17:42:18 Using IPEndPoint() seems to violate the API promis
Raul Vera 2017/04/17 23:51:57 The AdoptConnectedSocket method on TCPSocketPosix
mmenke 2017/04/18 16:15:24 I'm not seeing a consumer in the chrome repo that
+}
+#endif
+
TCPServerSocket::~TCPServerSocket() {
}

Powered by Google App Engine
This is Rietveld 408576698