Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
basic_datagram_socket::receive_from_multiple (2 of 6 overloads)

Receive multiple datagrams with the endpoints of the senders.

template<
    typename MutableBufferSequences,
    typename MutableEndpointSequence,
    typename MutableSizeSequence>
std::size_t receive_from_multiple(
    MutableBufferSequences && buffer_sequences,
    MutableEndpointSequence && endpoints,
    MutableSizeSequence && sizes,
    socket_base::message_flags flags);

This function is used to receive multiple datagrams, recording the endpoint of the remote sender of each. The function call will block until one or more datagrams have been received successfully or an error occurs. The number of datagrams transferred may be less than the length of the shortest range.

Parameters

buffer_sequences

A forward range of mutable buffer sequences, one per datagram, into which the data will be received.

endpoints

A forward range of endpoint objects, one per datagram, that receive the endpoint of the remote sender of each datagram.

sizes

A forward range of std::size_t, one per datagram, into which the number of bytes received in each datagram is written.

flags

Flags specifying how the receive call is to be made.

Return Value

The number of datagrams received.

Exceptions

boost::system::system_error

Thrown on failure.


PrevUpHomeNext