Trying to use boost::asio::write()to write to an object boost::asio::ip::udp::socket. While I'm busy re-reading the documents to see if I have arrived somewhere, can someone confirm, maybe this is not supported? Now I think it boost::asio::write()only supports objects tcp::socket, not udp::socket.
This is what I get when I try to compile:
/usr/include/boost/asio/impl/write.ipp: In function ‘size_t
boost::asio::write(SyncWriteStream&, const ConstBufferSequence&, [...cut...]
test/test.cpp:76: instantiated from here
/usr/include/boost/asio/impl/write.ipp:44: error: ‘class
boost::asio::basic_datagram_socket<boost::asio::ip::udp,
boost::asio::datagram_socket_service<boost::asio::ip::udp> >’ has no member named
‘write_some’
I think I decided to try boost::asio::write()it when I read this in the docs:
The send operation may not transfer all data to the partner. Consider using the write function if you need to make sure that all data is written before the completion of the lock operation.
... but coming back, I see that the text is only in boost::asio::ip::tcp::socket::send(), not in the UDP version. Source
source
share