Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
basic_datagram_socket::receive_multiple (6 of 6 overloads)

Receive multiple datagrams and their flags on a connected socket.

template<
    typename MutableBufferSequences,
    typename MutableSizeSequence,
    typename MutableFlagsSequence>
std::size_t receive_multiple(
    MutableBufferSequences && buffer_sequences,
    MutableSizeSequence && sizes,
    socket_base::message_flags flags,
    MutableFlagsSequence && out_flags,
    boost::system::error_code & ec,
    constraint_t< is_shallow_mutable_sequence< decay_t< MutableFlagsSequence > >::value >  = 0);

This function is used to receive multiple datagrams on the datagram socket. 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.

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.

out_flags

A forward range of socket_base::message_flags, one per datagram, into which the flags associated with each received datagram are written.

ec

Set to indicate what error occurred, if any.

Return Value

The number of datagrams received.

Remarks

The receive_multiple operation can only be used with a connected socket. Use the receive_from_multiple function to receive data on an unconnected datagram socket.


PrevUpHomeNext