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_SOCKET_UDP_SERVER_SOCKET_H_ | 5 #ifndef NET_SOCKET_UDP_SERVER_SOCKET_H_ |
6 #define NET_SOCKET_UDP_SERVER_SOCKET_H_ | 6 #define NET_SOCKET_UDP_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_server_socket.h" | 10 #include "net/udp/datagram_server_socket.h" |
11 #include "net/udp/udp_socket.h" | 11 #include "net/udp/udp_socket.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 class IPEndPoint; | 15 class IPEndPoint; |
16 class BoundNetLog; | 16 class BoundNetLog; |
17 | 17 |
18 // A client socket that uses UDP as the transport layer. | 18 // A client socket that uses UDP as the transport layer. |
19 class NET_EXPORT UDPServerSocket : public DatagramServerSocket { | 19 class NET_EXPORT UDPServerSocket : public DatagramServerSocket { |
20 public: | 20 public: |
21 UDPServerSocket(net::NetLog* net_log, const net::NetLog::Source& source); | 21 UDPServerSocket(net::NetLog* net_log, const net::NetLog::Source& source); |
22 virtual ~UDPServerSocket(); | 22 virtual ~UDPServerSocket(); |
23 | 23 |
24 // Implement DatagramServerSocket: | 24 // Implement DatagramServerSocket: |
25 virtual int Listen(const IPEndPoint& address) OVERRIDE; | 25 virtual int Listen(const IPEndPoint& address) override; |
26 virtual int RecvFrom(IOBuffer* buf, | 26 virtual int RecvFrom(IOBuffer* buf, |
27 int buf_len, | 27 int buf_len, |
28 IPEndPoint* address, | 28 IPEndPoint* address, |
29 const CompletionCallback& callback) OVERRIDE; | 29 const CompletionCallback& callback) override; |
30 virtual int SendTo(IOBuffer* buf, | 30 virtual int SendTo(IOBuffer* buf, |
31 int buf_len, | 31 int buf_len, |
32 const IPEndPoint& address, | 32 const IPEndPoint& address, |
33 const CompletionCallback& callback) OVERRIDE; | 33 const CompletionCallback& callback) override; |
34 virtual int SetReceiveBufferSize(int32 size) OVERRIDE; | 34 virtual int SetReceiveBufferSize(int32 size) override; |
35 virtual int SetSendBufferSize(int32 size) OVERRIDE; | 35 virtual int SetSendBufferSize(int32 size) override; |
36 virtual void Close() OVERRIDE; | 36 virtual void Close() override; |
37 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; | 37 virtual int GetPeerAddress(IPEndPoint* address) const override; |
38 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; | 38 virtual int GetLocalAddress(IPEndPoint* address) const override; |
39 virtual const BoundNetLog& NetLog() const OVERRIDE; | 39 virtual const BoundNetLog& NetLog() const override; |
40 virtual void AllowAddressReuse() OVERRIDE; | 40 virtual void AllowAddressReuse() override; |
41 virtual void AllowBroadcast() OVERRIDE; | 41 virtual void AllowBroadcast() override; |
42 virtual int JoinGroup(const IPAddressNumber& group_address) const OVERRIDE; | 42 virtual int JoinGroup(const IPAddressNumber& group_address) const override; |
43 virtual int LeaveGroup(const IPAddressNumber& group_address) const OVERRIDE; | 43 virtual int LeaveGroup(const IPAddressNumber& group_address) const override; |
44 virtual int SetMulticastInterface(uint32 interface_index) OVERRIDE; | 44 virtual int SetMulticastInterface(uint32 interface_index) override; |
45 virtual int SetMulticastTimeToLive(int time_to_live) OVERRIDE; | 45 virtual int SetMulticastTimeToLive(int time_to_live) override; |
46 virtual int SetMulticastLoopbackMode(bool loopback) OVERRIDE; | 46 virtual int SetMulticastLoopbackMode(bool loopback) override; |
47 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) OVERRIDE; | 47 virtual int SetDiffServCodePoint(DiffServCodePoint dscp) override; |
48 virtual void DetachFromThread() OVERRIDE; | 48 virtual void DetachFromThread() override; |
49 | 49 |
50 private: | 50 private: |
51 UDPSocket socket_; | 51 UDPSocket socket_; |
52 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); | 52 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace net | 55 } // namespace net |
56 | 56 |
57 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ | 57 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ |
OLD | NEW |