Index: net/udp/udp_socket_win.h |
diff --git a/net/udp/udp_socket_win.h b/net/udp/udp_socket_win.h |
index bc97d5683655a0fc773d36eadbd535e18c096706..40851b0c73c35aa39def64a32d736280658bd68e 100644 |
--- a/net/udp/udp_socket_win.h |
+++ b/net/udp/udp_socket_win.h |
@@ -108,15 +108,23 @@ class NET_EXPORT UDPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
const BoundNetLog& NetLog() const { return net_log_; } |
- // 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(); |
+ // Allows the socket to share the local address to which the socket will |
+ // be bound with other processes. |
+ // Returns a net error code. |
+ int AllowAddressReuse(); |
+ |
+ // Disallows the socket to share the local address to which the socket will |
+ // be bound with other processes. |
+ // Returns a net error code. |
+ int DisallowAddressReuse(); |
+ |
+ // Allows sending and receiving packets to and from broadcast addresses. |
+ // Returns a net error code. |
+ int AllowBroadcast(); |
- // Sets corresponding flags in |socket_options_| to allow sending |
- // and receiving packets to and from broadcast addresses. Should be |
- // called before Bind(). |
- void AllowBroadcast(); |
+ // Disallows sending and receiving packets to and from broadcast addresses. |
+ // Returns a net error code. |
+ int DisallowBroadcast(); |
// Join the multicast group. |
// |group_address| is the group address to join, could be either |
@@ -171,7 +179,9 @@ class NET_EXPORT UDPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
enum SocketOptions { |
SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, |
SOCKET_OPTION_BROADCAST = 1 << 1, |
- SOCKET_OPTION_MULTICAST_LOOP = 1 << 2 |
+ SOCKET_OPTION_MULTICAST_LOOP = 1 << 2, |
+ SOCKET_OPTION_RCVBUF_SIZE = 1 << 3, |
+ SOCKET_OPTION_SNDBUF_SIZE = 1 << 4 |
}; |
class Core; |
@@ -205,6 +215,11 @@ class NET_EXPORT UDPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
// Applies |socket_options_| to |socket_|. Should be called before |
jar (doing other things)
2014/11/04 22:51:09
What does this "Should...." comment mean now?
hidehiko
2014/11/05 12:48:30
Maybe we should say DoBind rather than Bind.
To be
|
// Bind(). |
int SetSocketOptions(); |
+ int SetAddressReuseInternal(bool value); |
+ int SetBroadcastInternal(bool value); |
jar (doing other things)
2014/11/04 22:51:09
nit: please use a better variable name in the abov
hidehiko
2014/11/05 12:48:30
Done.
|
+ int SetReceiveBufferSizeInternal(int32 size); |
+ int SetSendBufferSizeInternal(int32 size); |
+ |
int DoBind(const IPEndPoint& address); |
// Binds to a random port on |address|. |
int RandomBind(const IPAddressNumber& address); |
@@ -220,6 +235,11 @@ class NET_EXPORT UDPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
// options that should be applied to |socket_| before Bind(). |
int socket_options_; |
+ // Buffer size set before Bind(). This should be applied |
jar (doing other things)
2014/11/04 22:51:09
Rather than the passive voice "This should..." Pl
hidehiko
2014/11/05 12:48:30
Done.
|
+ // in SetSocketOptions(). |
+ int32 rcvbuf_size_; |
+ int32 sndbuf_size_; |
+ |
// Multicast interface. |
uint32 multicast_interface_; |