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/udp/datagram_socket.h" | 10 #include "net/udp/datagram_socket.h" |
10 | 11 |
11 namespace net { | 12 namespace net { |
12 | 13 |
13 class IPEndPoint; | 14 class IPEndPoint; |
14 class IOBuffer; | 15 class IOBuffer; |
15 | 16 |
16 // A UDP Socket. | 17 // A UDP Socket. |
17 class NET_EXPORT DatagramServerSocket : public DatagramSocket { | 18 class NET_EXPORT DatagramServerSocket : public DatagramSocket { |
18 public: | 19 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // Set the send buffer size (in bytes) for the socket. | 61 // Set the send buffer size (in bytes) for the socket. |
61 virtual bool SetSendBufferSize(int32 size) = 0; | 62 virtual bool SetSendBufferSize(int32 size) = 0; |
62 | 63 |
63 // Allow the socket to share the local address to which the socket will | 64 // Allow the socket to share the local address to which the socket will |
64 // be bound with other processes. Should be called before Listen(). | 65 // be bound with other processes. Should be called before Listen(). |
65 virtual void AllowAddressReuse() = 0; | 66 virtual void AllowAddressReuse() = 0; |
66 | 67 |
67 // Allow sending and receiving packets to and from broadcast addresses. | 68 // Allow sending and receiving packets to and from broadcast addresses. |
68 // Should be called before Listen(). | 69 // Should be called before Listen(). |
69 virtual void AllowBroadcast() = 0; | 70 virtual void AllowBroadcast() = 0; |
71 | |
72 // Join the multicast group. | |
73 // |group_address| is the group address to join, could be either | |
Sergey Ulanov
2013/06/07 19:59:38
nit: Suggest rephrasing: "Join multicast group wit
| |
74 // an IPv4 or IPv6 address. | |
75 // Return a network error code. | |
Sergey Ulanov
2013/06/07 19:59:38
nit: s/Return/Returns/, here and below.
| |
76 virtual int JoinGroup(const IPAddressNumber& group_address) const = 0; | |
77 | |
78 // Leave the multicast group. | |
79 // |group_address| is the group address to leave, could be either | |
Sergey Ulanov
2013/06/07 19:59:38
Repharase similar to JoinGroup() please.
| |
80 // an IPv4 or IPv6 address. If the socket hasn't joined the group, | |
81 // it will be ignored. | |
82 // It's optional to leave the multicast group before destroying | |
83 // the socket. It will be done by the OS. | |
84 // Return a network error code. | |
85 virtual int LeaveGroup(const IPAddressNumber& group_address) const = 0; | |
86 | |
87 // Set the time-to-live option for UDP packets sent to the multicast | |
88 // group address. The default value of this option is 1. | |
89 // Cannot be negative or more than 255. | |
90 // Should be called before Bind(). | |
91 // Return a network error code. | |
92 virtual int SetMulticastTimeToLive(int time_to_live) = 0; | |
93 | |
94 // Set the loopback flag for UDP socket. If this flag is true, the host | |
95 // will receive packets sent to the joined group from itself. | |
96 // The default value of this option is true. | |
97 // Should be called before Bind(). | |
98 // Return a network error code. | |
99 virtual int SetMulticastLoopbackMode(bool loopback) = 0; | |
70 }; | 100 }; |
71 | 101 |
72 } // namespace net | 102 } // namespace net |
73 | 103 |
74 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ | 104 #endif // NET_UDP_DATAGRAM_SERVER_SOCKET_H_ |
OLD | NEW |