| 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_UDP_DATAGRAM_SOCKET_H_ | 5 #ifndef NET_UDP_DATAGRAM_SOCKET_H_ |
| 6 #define NET_UDP_DATAGRAM_SOCKET_H_ | 6 #define NET_UDP_DATAGRAM_SOCKET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "net/base/net_api.h" |
| 10 |
| 9 namespace net { | 11 namespace net { |
| 10 | 12 |
| 11 class IPEndPoint; | 13 class IPEndPoint; |
| 12 | 14 |
| 13 // A datagram socket is an interface to a protocol which exchanges | 15 // A datagram socket is an interface to a protocol which exchanges |
| 14 // datagrams, like UDP. | 16 // datagrams, like UDP. |
| 15 class DatagramSocket { | 17 class NET_TEST DatagramSocket { |
| 16 public: | 18 public: |
| 17 virtual ~DatagramSocket() {} | 19 virtual ~DatagramSocket() {} |
| 18 | 20 |
| 19 // Close the socket. | 21 // Close the socket. |
| 20 virtual void Close() = 0; | 22 virtual void Close() = 0; |
| 21 | 23 |
| 22 // Copy the remote udp address into |address| and return a network error code. | 24 // Copy the remote udp address into |address| and return a network error code. |
| 23 virtual int GetPeerAddress(IPEndPoint* address) const = 0; | 25 virtual int GetPeerAddress(IPEndPoint* address) const = 0; |
| 24 | 26 |
| 25 // Copy the local udp address into |address| and return a network error code. | 27 // Copy the local udp address into |address| and return a network error code. |
| 26 // (similar to getsockname) | 28 // (similar to getsockname) |
| 27 virtual int GetLocalAddress(IPEndPoint* address) const = 0; | 29 virtual int GetLocalAddress(IPEndPoint* address) const = 0; |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 } // namespace net | 32 } // namespace net |
| 31 | 33 |
| 32 #endif // NET_UDP_DATAGRAM_SOCKET_H_ | 34 #endif // NET_UDP_DATAGRAM_SOCKET_H_ |
| OLD | NEW |