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/udp/datagram_client_socket.h" | 10 #include "net/udp/datagram_client_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 BoundNetLog; | 15 class BoundNetLog; |
16 | 16 |
17 // A client socket that uses UDP as the transport layer. | 17 // A client socket that uses UDP as the transport layer. |
18 class UDPClientSocket : public DatagramClientSocket { | 18 class NET_TEST UDPClientSocket : public DatagramClientSocket { |
Sergey Ulanov
2011/05/18 22:54:07
Why is this NET_TEST instead of NET_API?
rvargas (doing something else)
2011/05/19 22:02:27
Because there is nobody outside net using this cod
| |
19 public: | 19 public: |
20 UDPClientSocket(net::NetLog* net_log, | 20 UDPClientSocket(net::NetLog* net_log, |
21 const net::NetLog::Source& source); | 21 const net::NetLog::Source& source); |
22 virtual ~UDPClientSocket(); | 22 virtual ~UDPClientSocket(); |
23 | 23 |
24 // Implement DatagramClientSocket: | 24 // Implement DatagramClientSocket: |
25 virtual int Connect(const IPEndPoint& address); | 25 virtual int Connect(const IPEndPoint& address); |
26 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 26 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
27 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 27 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
28 virtual void Close(); | 28 virtual void Close(); |
29 virtual int GetPeerAddress(IPEndPoint* address) const; | 29 virtual int GetPeerAddress(IPEndPoint* address) const; |
30 virtual int GetLocalAddress(IPEndPoint* address) const; | 30 virtual int GetLocalAddress(IPEndPoint* address) const; |
31 virtual bool SetReceiveBufferSize(int32 size); | 31 virtual bool SetReceiveBufferSize(int32 size); |
32 virtual bool SetSendBufferSize(int32 size); | 32 virtual bool SetSendBufferSize(int32 size); |
33 | 33 |
34 private: | 34 private: |
35 UDPSocket socket_; | 35 UDPSocket socket_; |
36 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); | 36 DISALLOW_COPY_AND_ASSIGN(UDPClientSocket); |
37 }; | 37 }; |
38 | 38 |
39 } // namespace net | 39 } // namespace net |
40 | 40 |
41 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ | 41 #endif // NET_SOCKET_UDP_CLIENT_SOCKET_H_ |
OLD | NEW |