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
3 // found in the LICENSE file.
5 #ifndef NET_UDP_DATAGRAM_SOCKET_H_
6 #define NET_UDP_DATAGRAM_SOCKET_H_
8 #include "net/base/net_export.h"
15 // A datagram socket is an interface to a protocol which exchanges
16 // datagrams, like UDP.
17 class NET_EXPORT_PRIVATE DatagramSocket
{
19 // Type of source port binding to use.
25 virtual ~DatagramSocket() {}
28 virtual void Close() = 0;
30 // Copy the remote udp address into |address| and return a network error code.
31 virtual int GetPeerAddress(IPEndPoint
* address
) const = 0;
33 // Copy the local udp address into |address| and return a network error code.
34 // (similar to getsockname)
35 virtual int GetLocalAddress(IPEndPoint
* address
) const = 0;
37 // Gets the NetLog for this socket.
38 virtual const BoundNetLog
& NetLog() const = 0;
43 #endif // NET_UDP_DATAGRAM_SOCKET_H_