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

Unified Diff: net/socket/tcp_server_socket.h

Issue 2815993002: Adds a method to TCPServerSocket to adopt a socket. (Closed)
Patch Set: Refined GetSocketDescriptor per review. 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
« no previous file with comments | « net/socket/socket_posix.cc ('k') | net/socket/tcp_server_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_server_socket.h
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h
index 3b4a9616ede4bdbe921ab63f7f5a627ec70b1231..58f3a4422296dda2577bd29e37c94ba47a6c739b 100644
--- a/net/socket/tcp_server_socket.h
+++ b/net/socket/tcp_server_socket.h
@@ -11,6 +11,7 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_export.h"
#include "net/socket/server_socket.h"
+#include "net/socket/socket_descriptor.h"
#include "net/socket/tcp_socket.h"
namespace net {
@@ -24,6 +25,12 @@ class NET_EXPORT TCPServerSocket : public ServerSocket {
TCPServerSocket(NetLog* net_log, const NetLogSource& source);
~TCPServerSocket() override;
+ // Takes ownership of |socket|, which has been opened, but may or may not be
+ // bound or listening. The caller must determine this based on the provenance
+ // of the socket and act accordingly. The socket may have connections waiting
+ // to be accepted, but must not be actually connected.
+ int AdoptSocket(SocketDescriptor socket);
+
// net::ServerSocket implementation.
int Listen(const IPEndPoint& address, int backlog) override;
int GetLocalAddress(IPEndPoint* address) const override;
« no previous file with comments | « net/socket/socket_posix.cc ('k') | net/socket/tcp_server_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698