5
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11
#ifndef ASIO_IP_UDP_HPP
12
#define ASIO_IP_UDP_HPP
14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
16
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18
#include "asio/detail/push_options.hpp"
20
#include "asio/basic_datagram_socket.hpp"
21
#include "asio/ip/basic_endpoint.hpp"
22
#include "asio/ip/basic_resolver.hpp"
23
#include "asio/ip/basic_resolver_iterator.hpp"
24
#include "asio/ip/basic_resolver_query.hpp"
25
#include "asio/detail/socket_types.hpp"
30
/// Encapsulates the flags needed for UDP.
32
* The asio::ip::udp class contains flags necessary for UDP sockets.
35
* @e Distinct @e objects: Safe.@n
36
* @e Shared @e objects: Safe.
39
* Protocol, InternetProtocol.
44
/// The type of a UDP endpoint.
45
typedef basic_endpoint<udp> endpoint;
47
/// The type of a resolver query.
48
typedef basic_resolver_query<udp> resolver_query;
50
/// The type of a resolver iterator.
51
typedef basic_resolver_iterator<udp> resolver_iterator;
53
/// Construct to represent the IPv4 UDP protocol.
59
/// Construct to represent the IPv6 UDP protocol.
65
/// Obtain an identifier for the type of the protocol.
71
/// Obtain an identifier for the protocol.
77
/// Obtain an identifier for the protocol family.
83
/// The UDP socket type.
84
typedef basic_datagram_socket<udp> socket;
86
/// The UDP resolver type.
87
typedef basic_resolver<udp> resolver;
89
/// Compare two protocols for equality.
90
friend bool operator==(const udp& p1, const udp& p2)
92
return p1.family_ == p2.family_;
95
/// Compare two protocols for inequality.
96
friend bool operator!=(const udp& p1, const udp& p2)
98
return p1.family_ != p2.family_;
102
// Construct with a specific family.
103
explicit udp(int family)
114
#include "asio/detail/pop_options.hpp"
116
#endif // ASIO_IP_UDP_HPP