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

Click here to view the latest version of this page.
basic_seq_packet_socket::send (2 of 2 overloads)

Send some data on the 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 sequenced packet socket. The function call will block the data has been sent successfully, or an until 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. Returns 0 if an error occurred.


The send operation may not transmit all of the data to the peer. Consider using the write function if you need to ensure that all data is written before the blocking operation completes.