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..4ec879aaff53cc3d65f7b5aece0bed57cb55d5d5 100644 |
--- a/net/socket/tcp_server_socket_libevent.h |
+++ b/net/socket/tcp_server_socket_libevent.h |
@@ -35,12 +35,29 @@ class NET_EXPORT_PRIVATE TCPServerSocketLibevent |
virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
+ // 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 { |
Sergey Ulanov
2012/09/12 19:38:24
types must be defined before methods.
justinlin
2012/09/12 21:11:00
Ack.
|
+ SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
+ }; |
+ |
+ // Applies |socket_options_| to |socket_|. Should be called before |
+ // Bind(). |
+ int SetSocketOptions(); |
+ |
int socket_; |
+ // Bitwise-or'd combination of SocketOptions. Specifies the set of |
+ // options that should be applied to |socket_| before Bind(). |
+ int socket_options_; |
Sergey Ulanov
2012/09/12 19:38:24
Do we really need these options to be bit flags? i
Sergey Ulanov
2012/09/12 19:38:24
You need to initialize this variable in the constr
justinlin
2012/09/12 21:11:00
Done.
justinlin
2012/09/12 21:11:00
Done.
|
+ |
MessageLoopForIO::FileDescriptorWatcher accept_socket_watcher_; |
scoped_ptr<StreamSocket>* accept_socket_; |