11 #ifndef ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP 12 #define ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 54 : family_(address_family),
55 protocol_(socket_protocol)
63 template <
typename Protocol>
65 : family_(source_protocol.
family()),
66 protocol_(source_protocol.
protocol())
68 if (source_protocol.type() !=
type())
97 return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_;
123 #endif // ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP Encapsulates the flags needed for a generic datagram-oriented socket.
friend bool operator!=(const datagram_protocol &p1, const datagram_protocol &p2)
Compare two protocols for inequality.
datagram_protocol(int address_family, int socket_protocol)
Construct a protocol object for a specific address family and protocol.
Provides datagram-oriented socket functionality.
friend bool operator==(const datagram_protocol &p1, const datagram_protocol &p2)
Compare two protocols for equality.
datagram_protocol(const Protocol &source_protocol)
Construct a generic protocol object from a specific protocol.
basic_endpoint< datagram_protocol > endpoint
The type of an endpoint.
int type() const
Obtain an identifier for the type of the protocol.
int family() const
Obtain an identifier for the protocol family.
int protocol() const
Obtain an identifier for the protocol.
basic_datagram_socket< datagram_protocol > socket
The generic socket type.
void throw_exception(const Exception &e)
Describes an endpoint for any socket type.