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

Unified Diff: net/socket/tcp_server_socket_libevent.h

Issue 10907154: Allow server sockets to rebind to same port if there is nothing actively listening on that port. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows build Created 8 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
« no previous file with comments | « no previous file | net/socket/tcp_server_socket_libevent.cc » ('j') | net/socket/tcp_server_socket_libevent.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_server_socket_libevent.h
diff --git a/net/socket/tcp_server_socket_libevent.h b/net/socket/tcp_server_socket_libevent.h
index 946cc50f949d56911d0a0a437a0c02b3dfd95165..3edee1159d39f38cccbf637c6075ca8065718947 100644
--- a/net/socket/tcp_server_socket_libevent.h
+++ b/net/socket/tcp_server_socket_libevent.h
@@ -31,11 +31,17 @@ class NET_EXPORT_PRIVATE TCPServerSocketLibevent
virtual int Accept(scoped_ptr<StreamSocket>* socket,
const CompletionCallback& callback) OVERRIDE;
+ // Sets corresponding flags to allow the socket to share the local address to
wtc 2012/09/13 18:31:55 Please make the following changes to tcp_server_so
justinlin 2012/09/14 03:54:40 Done. Also moved the comment to interface.
+ // which the socket will be bound with other processes. Should be called
+ // before Bind().
+ void AllowAddressReuse();
+
// MessageLoopForIO::Watcher implementation.
virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
private:
+ int SetSocketOptions();
int AcceptInternal(scoped_ptr<StreamSocket>* socket);
void Close();
@@ -46,6 +52,8 @@ class NET_EXPORT_PRIVATE TCPServerSocketLibevent
scoped_ptr<StreamSocket>* accept_socket_;
CompletionCallback accept_callback_;
+ bool reuse_address_;
+
BoundNetLog net_log_;
};
« no previous file with comments | « no previous file | net/socket/tcp_server_socket_libevent.cc » ('j') | net/socket/tcp_server_socket_libevent.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698