Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
basic_datagram_socket::send (3 of 3 overloads)

Send some data on a connected socket.

    typename ConstBufferSequence>
std::size_t send(
    const ConstBufferSequence & buffers,
    socket_base::message_flags flags,
    boost::system::error_code & ec);

This function is used to send data on the datagram socket. The function call will block until the data has been sent successfully or an error occurs.



One or more data buffers to be sent on the socket.


Flags specifying how the send call is to be made.


Set to indicate what error occurred, if any.

Return Value

The number of bytes sent.


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