| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 5 #ifndef NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| 6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 6 #define NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| 7 | 7 |
| 8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
| 10 #include "net/udp/datagram_socket.h" | 10 #include "net/udp/datagram_socket.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // Set the receive buffer size (in bytes) for the socket. | 58 // Set the receive buffer size (in bytes) for the socket. |
| 59 // Returns a net error code. | 59 // Returns a net error code. |
| 60 virtual int SetReceiveBufferSize(int32 size) = 0; | 60 virtual int SetReceiveBufferSize(int32 size) = 0; |
| 61 | 61 |
| 62 // Set the send buffer size (in bytes) for the socket. | 62 // Set the send buffer size (in bytes) for the socket. |
| 63 // Returns a net error code. | 63 // Returns a net error code. |
| 64 virtual int SetSendBufferSize(int32 size) = 0; | 64 virtual int SetSendBufferSize(int32 size) = 0; |
| 65 | 65 |
| 66 // Allow the socket to share the local address to which the socket will | 66 // Allow the socket to share the local address to which the socket will |
| 67 // be bound with other processes. Should be called before Listen(). | 67 // be bound with other processes. |
| 68 virtual void AllowAddressReuse() = 0; | 68 virtual int AllowAddressReuse() = 0; |
| 69 |
| 70 // Disallow the socket to share the local address to which the socket will |
| 71 // be bound with other processes. |
| 72 virtual int DisallowAddressReuse() = 0; |
| 69 | 73 |
| 70 // Allow sending and receiving packets to and from broadcast addresses. | 74 // Allow sending and receiving packets to and from broadcast addresses. |
| 71 // Should be called before Listen(). | 75 virtual int AllowBroadcast() = 0; |
| 72 virtual void AllowBroadcast() = 0; | 76 |
| 77 // Disallow sending and receiving packets to and from broadcast addresses. |
| 78 virtual int DisallowBroadcast() = 0; |
| 73 | 79 |
| 74 // Join the multicast group with address |group_address|. | 80 // Join the multicast group with address |group_address|. |
| 75 // Returns a network error code. | 81 // Returns a network error code. |
| 76 virtual int JoinGroup(const IPAddressNumber& group_address) const = 0; | 82 virtual int JoinGroup(const IPAddressNumber& group_address) const = 0; |
| 77 | 83 |
| 78 // Leave the multicast group with address |group_address|. | 84 // Leave the multicast group with address |group_address|. |
| 79 // If the socket hasn't joined the group, it will be ignored. | 85 // If the socket hasn't joined the group, it will be ignored. |
| 80 // It's optional to leave the multicast group before destroying | 86 // It's optional to leave the multicast group before destroying |
| 81 // the socket. It will be done by the OS. | 87 // the socket. It will be done by the OS. |
| 82 // Returns a network error code. | 88 // Returns a network error code. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 106 // some platforms. Returns a network error code. | 112 // some platforms. Returns a network error code. |
| 107 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; | 113 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) = 0; |
| 108 | 114 |
| 109 // Resets the thread to be used for thread-safety checks. | 115 // Resets the thread to be used for thread-safety checks. |
| 110 virtual void DetachFromThread() = 0; | 116 virtual void DetachFromThread() = 0; |
| 111 }; | 117 }; |
| 112 | 118 |
| 113 } // namespace net | 119 } // namespace net |
| 114 | 120 |
| 115 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 121 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
| OLD | NEW |