Index: net/socket/tcp_server_socket_win.h |
diff --git a/net/socket/tcp_server_socket_win.h b/net/socket/tcp_server_socket_win.h |
index a7ab78cd4e9dc51c7dc399675722d2189f31a6fe..ff78c0f4ab08f3549409db70a3852c625eb9e38a 100644 |
--- a/net/socket/tcp_server_socket_win.h |
+++ b/net/socket/tcp_server_socket_win.h |
@@ -37,13 +37,30 @@ class NET_EXPORT_PRIVATE TCPServerSocketWin |
// base::ObjectWatcher::Delegate implementation. |
virtual void OnObjectSignaled(HANDLE object); |
+ // Sets corresponding flags in |socket_options_| to allow the socket |
+ // to share the local address to which the socket will be bound with |
+ // other processes. Should be called before Bind(). |
+ void AllowAddressReuse(); |
+ |
private: |
int AcceptInternal(scoped_ptr<StreamSocket>* socket); |
void Close(); |
+ enum SocketOptions { |
+ SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
+ } |
Sergey Ulanov
2012/09/12 19:38:24
I think you are missing semicolon here
justinlin
2012/09/12 21:11:00
Ack
|
+ |
+ // Applies |socket_options_| to |socket_|. Should be called before |
+ // Bind(). |
+ int SetSocketOptions(); |
+ |
SOCKET socket_; |
HANDLE socket_event_; |
+ // Bitwise-or'd combination of SocketOptions. Specifies the set of |
+ // options that should be applied to |socket_| before Bind(). |
+ int socket_options_; |
+ |
base::win::ObjectWatcher accept_watcher_; |
scoped_ptr<StreamSocket>* accept_socket_; |