| Home | Libraries | People | FAQ | More

##### basic_datagram_socket::send (1 of 3 overloads)

Send some data on a connected socket.

    template<
        typename ConstBufferSequence>
    std::size_t send(
        const ConstBufferSequence & buffers);

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.

###### Parameters

buffers

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

###### Return Value

The number of bytes sent.

###### Exceptions

boost::system::system_error

  Thrown on failure.

###### Remarks

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

###### Example

To send a single data buffer use the buffer function as follows:

    socket.send(boost::asio::buffer(data, size));

See the buffer documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.