Index: net/udp/udp_socket_libevent.h |
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h |
index 3242e18f12cc112048e5db89b2fcec1fee389669..076ebe153dd282137a7b50407e9fe400aba5b3d4 100644 |
--- a/net/udp/udp_socket_libevent.h |
+++ b/net/udp/udp_socket_libevent.h |
@@ -103,9 +103,18 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { |
const BoundNetLog& NetLog() const { return net_log_; } |
+ void AllowAddressReuse(); |
+ |
+ void AllowBroadcast(); |
wtc
2012/07/12 23:49:47
NOTE: all the changes I suggest for this file also
ygorshenin1
2012/07/16 10:29:44
Done.
|
+ |
private: |
static const int kInvalidSocket = -1; |
+ enum SocketOptions { |
+ SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
+ SOCKET_OPTION_BROADCAST = 1 << 1 |
+ }; |
+ |
class ReadWatcher : public MessageLoopForIO::Watcher { |
public: |
explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} |
@@ -172,10 +181,12 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { |
int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address); |
int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address); |
+ int SetSocketOptions(); |
int DoBind(const IPEndPoint& address); |
int RandomBind(const IPEndPoint& address); |
int socket_; |
+ int socket_options_; |
wtc
2012/07/12 23:49:47
Nit: document these members.
ygorshenin1
2012/07/16 10:29:44
Done.
|
// How to do source port binding, used only when UDPSocket is part of |
// UDPClientSocket, since UDPServerSocket provides Bind. |