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_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
6 #define NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/base/rand_callback.h" | 10 #include "net/base/rand_callback.h" |
11 #include "net/udp/datagram_client_socket.h" | 11 #include "net/udp/datagram_client_socket.h" |
12 #include "net/udp/udp_socket.h" | 12 #include "net/udp/udp_socket.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
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_TEST UDPClientSocket : public DatagramClientSocket { | 19 class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket { |
20 public: | 20 public: |
21 UDPClientSocket(DatagramSocket::BindType bind_type, | 21 UDPClientSocket(DatagramSocket::BindType bind_type, |
22 const RandIntCallback& rand_int_cb, | 22 const RandIntCallback& rand_int_cb, |
23 net::NetLog* net_log, | 23 net::NetLog* net_log, |
24 const net::NetLog::Source& source); | 24 const net::NetLog::Source& source); |
25 virtual ~UDPClientSocket(); | 25 virtual ~UDPClientSocket(); |
26 | 26 |
27 // Implement DatagramClientSocket: | 27 // Implement DatagramClientSocket: |
28 virtual int Connect(const IPEndPoint& address); | 28 virtual int Connect(const IPEndPoint& address); |
29 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 29 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
30 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 30 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
31 virtual void Close(); | 31 virtual void Close(); |
32 virtual int GetPeerAddress(IPEndPoint* address) const; | 32 virtual int GetPeerAddress(IPEndPoint* address) const; |
33 virtual int GetLocalAddress(IPEndPoint* address) const; | 33 virtual int GetLocalAddress(IPEndPoint* address) const; |
34 virtual bool SetReceiveBufferSize(int32 size); | 34 virtual bool SetReceiveBufferSize(int32 size); |
35 virtual bool SetSendBufferSize(int32 size); | 35 virtual bool SetSendBufferSize(int32 size); |
36 virtual const BoundNetLog& NetLog() const; | 36 virtual const BoundNetLog& NetLog() const; |
37 | 37 |
38 private: | 38 private: |
39 UDPSocket socket_; | 39 UDPSocket socket_; |
40 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); | 40 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace net | 43 } // namespace net |
44 | 44 |
45 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 45 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
OLD | NEW |