11 #ifndef ASIO_BASIC_DATAGRAM_SOCKET_HPP 12 #define ASIO_BASIC_DATAGRAM_SOCKET_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 40 template <
typename Protocol,
41 typename DatagramSocketService = datagram_socket_service<Protocol> >
48 typedef typename DatagramSocketService::native_handle_type
native_type;
69 :
basic_socket<Protocol, DatagramSocketService>(io_service)
86 const protocol_type& protocol)
87 :
basic_socket<Protocol, DatagramSocketService>(io_service, protocol)
108 const endpoint_type& endpoint)
109 :
basic_socket<Protocol, DatagramSocketService>(io_service, endpoint)
129 const protocol_type& protocol,
const native_handle_type& native_socket)
131 io_service, protocol, native_socket)
135 #if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 181 template <
typename Protocol1,
typename DatagramSocketService1>
184 typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
187 Protocol1, DatagramSocketService1>)(other))
203 template <
typename Protocol1,
typename DatagramSocketService1>
210 Protocol1, DatagramSocketService1>)(other));
213 #endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 237 template <
typename ConstBufferSequence>
264 template <
typename ConstBufferSequence>
292 template <
typename ConstBufferSequence>
335 template <
typename ConstBufferSequence,
typename WriteHandler>
338 async_send(
const ConstBufferSequence&
buffers,
377 template <
typename ConstBufferSequence,
typename WriteHandler>
380 async_send(
const ConstBufferSequence& buffers,
417 template <
typename ConstBufferSequence>
418 std::size_t
send_to(
const ConstBufferSequence& buffers,
444 template <
typename ConstBufferSequence>
445 std::size_t
send_to(
const ConstBufferSequence& buffers,
471 template <
typename ConstBufferSequence>
472 std::size_t
send_to(
const ConstBufferSequence& buffers,
477 buffers, destination, flags, ec);
517 template <
typename ConstBufferSequence,
typename WriteHandler>
520 async_send_to(
const ConstBufferSequence& buffers,
560 template <
typename ConstBufferSequence,
typename WriteHandler>
563 async_send_to(
const ConstBufferSequence& buffers,
600 template <
typename MutableBufferSequence>
601 std::size_t
receive(
const MutableBufferSequence& buffers)
628 template <
typename MutableBufferSequence>
629 std::size_t
receive(
const MutableBufferSequence& buffers,
657 template <
typename MutableBufferSequence>
658 std::size_t
receive(
const MutableBufferSequence& buffers,
701 template <
typename MutableBufferSequence,
typename ReadHandler>
704 async_receive(
const MutableBufferSequence& buffers,
743 template <
typename MutableBufferSequence,
typename ReadHandler>
746 async_receive(
const MutableBufferSequence& buffers,
784 template <
typename MutableBufferSequence>
811 template <
typename MutableBufferSequence>
838 template <
typename MutableBufferSequence>
844 buffers, sender_endpoint, flags, ec);
883 template <
typename MutableBufferSequence,
typename ReadHandler>
886 async_receive_from(
const MutableBufferSequence& buffers,
928 template <
typename MutableBufferSequence,
typename ReadHandler>
931 async_receive_from(
const MutableBufferSequence& buffers,
949 #endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP int message_flags
Bitmask type for flags that can be passed to send and receive operations.
std::size_t send(const ConstBufferSequence &buffers)
Send some data on a connected socket.
endpoint_type ASIO_MOVE_ARG(ReadHandler) handler)
ASIO_MOVE_ARG(WriteHandler) handler)
void throw_error(const asio::error_code &err)
Provides core I/O functionality.
service_type & get_service()
Get the service associated with the I/O object.
#define ASIO_MOVE_CAST2(type1, type2)
std::size_t send_to(const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags, asio::error_code &ec)
Send a datagram to the specified endpoint.
socket_base::message_flags ASIO_MOVE_ARG(ReadHandler) handler)
const endpoint_type socket_base::message_flags ASIO_MOVE_ARG(WriteHandler) handler)
basic_datagram_socket(asio::io_service &io_service)
Construct a basic_datagram_socket without opening it.
std::size_t send_to(const ConstBufferSequence &buffers, const endpoint_type &destination)
Send a datagram to the specified endpoint.
ASIO_MOVE_ARG(ReadHandler) handler)
Protocol protocol_type
The protocol type.
Protocol::endpoint endpoint_type
The endpoint type.
basic_datagram_socket(asio::io_service &io_service, const protocol_type &protocol)
Construct and open a basic_datagram_socket.
const MutableBufferSequence & buffers
#define ASIO_READ_HANDLER_CHECK(handler_type, handler)
socket_base::message_flags ASIO_MOVE_ARG(WriteHandler) handler)
Provides datagram-oriented socket functionality.
const endpoint_type ASIO_MOVE_ARG(WriteHandler) handler)
std::size_t send_to(const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags)
Send a datagram to the specified endpoint.
std::size_t send(const ConstBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec)
Send some data on a connected socket.
DatagramSocketService::native_handle_type native_type
implementation_type & get_implementation()
Get the underlying implementation of the I/O object.
std::size_t receive(const MutableBufferSequence &buffers)
Receive some data on a connected socket.
basic_datagram_socket(asio::io_service &io_service, const endpoint_type &endpoint)
endpoint_type & sender_endpoint
Class to represent an error code value.
endpoint_type socket_base::message_flags ASIO_MOVE_ARG(ReadHandler) handler)
ASIO_INITFN_RESULT_TYPE(WriteHandler, void(asio::error_code, std::size_t)) async_send(const ConstBufferSequence &buffers
Start an asynchronous send on a connected socket.
std::size_t receive(const MutableBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec)
Receive some data on a connected socket.
Provides socket functionality.
std::size_t receive(const MutableBufferSequence &buffers, socket_base::message_flags flags)
Receive some data on a connected socket.
#define ASIO_MOVE_CAST(type)
const endpoint_type & destination
socket_base::message_flags flags
std::size_t receive_from(const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, asio::error_code &ec)
Receive a datagram with the endpoint of the sender.
#define ASIO_WRITE_HANDLER_CHECK(handler_type, handler)
std::size_t receive_from(const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags)
Receive a datagram with the endpoint of the sender.
std::size_t send(const ConstBufferSequence &buffers, socket_base::message_flags flags)
Send some data on a connected socket.
DatagramSocketService::native_handle_type native_handle_type
The native representation of a socket.
basic_datagram_socket(asio::io_service &io_service, const protocol_type &protocol, const native_handle_type &native_socket)
Construct a basic_datagram_socket on an existing native socket.
std::size_t receive_from(const MutableBufferSequence &buffers, endpoint_type &sender_endpoint)
Receive a datagram with the endpoint of the sender.