OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.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_API UDPServerSocket : public DatagramServerSocket { | 19 class NET_EXPORT UDPServerSocket : public DatagramServerSocket { |
20 public: | 20 public: |
21 UDPServerSocket(net::NetLog* net_log, | 21 UDPServerSocket(net::NetLog* net_log, |
22 const net::NetLog::Source& source); | 22 const net::NetLog::Source& source); |
23 virtual ~UDPServerSocket(); | 23 virtual ~UDPServerSocket(); |
24 | 24 |
25 // Implement DatagramServerSocket: | 25 // Implement DatagramServerSocket: |
26 virtual int Listen(const IPEndPoint& address); | 26 virtual int Listen(const IPEndPoint& address); |
27 virtual int RecvFrom(IOBuffer* buf, | 27 virtual int RecvFrom(IOBuffer* buf, |
28 int buf_len, | 28 int buf_len, |
29 IPEndPoint* address, | 29 IPEndPoint* address, |
30 CompletionCallback* callback); | 30 CompletionCallback* callback); |
31 virtual int SendTo(IOBuffer* buf, | 31 virtual int SendTo(IOBuffer* buf, |
32 int buf_len, | 32 int buf_len, |
33 const IPEndPoint& address, | 33 const IPEndPoint& address, |
34 CompletionCallback* callback); | 34 CompletionCallback* callback); |
35 virtual void Close(); | 35 virtual void Close(); |
36 virtual int GetPeerAddress(IPEndPoint* address) const; | 36 virtual int GetPeerAddress(IPEndPoint* address) const; |
37 virtual int GetLocalAddress(IPEndPoint* address) const; | 37 virtual int GetLocalAddress(IPEndPoint* address) const; |
38 virtual const BoundNetLog& NetLog() const; | 38 virtual const BoundNetLog& NetLog() const; |
39 | 39 |
40 private: | 40 private: |
41 UDPSocket socket_; | 41 UDPSocket socket_; |
42 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); | 42 DISALLOW_COPY_AND_ASSIGN(UDPServerSocket); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace net | 45 } // namespace net |
46 | 46 |
47 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ | 47 #endif // NET_SOCKET_UDP_SERVER_SOCKET_H_ |
OLD | NEW |