Я использую следующие методы:
boost::asio::streambuf io_bufstream;
boost::asio::async_read_until(socket_, io_bufstream, "</message>",
strand_.wrap(
boost::bind(&Connection::handleRead, shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred)));//warning: line 36
boost::array<char, 8192> buffer_
socket_.async_read_some(boost::asio::buffer(buffer_),
strand_.wrap(
boost::bind(&Connection::handleRead, shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred))); // warning
Я получаю следующее предупреждение:
C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(58) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
Вот также полный вывод:
C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(58) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(48) : while compiling class template member function 'bool boost::asio::detail::reactive_socket_recv_op_base::do_perform(boost::asio::detail::reactor_op *)'
with
[
MutableBufferSequence=boost::asio::mutable_buffers_1
]
C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_recv_op.hpp(71) : see reference to class template instantiation 'boost::asio::detail::reactive_socket_recv_op_base' being compiled
with
[
MutableBufferSequence=boost::asio::mutable_buffers_1
]
C:\dev\sapphire\boost_1_46_1\boost/asio/detail/reactive_socket_service_base.hpp(227) : see reference to class template instantiation 'boost::asio::detail::reactive_socket_recv_op' being compiled
with
[
MutableBufferSequence=boost::asio::mutable_buffers_1,
Handler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
]
C:\dev\sapphire\boost_1_46_1\boost/asio/stream_socket_service.hpp(263) : see reference to function template instantiation 'void boost::asio::detail::reactive_socket_service_base::async_receive(boost::asio::detail::reactive_socket_service_base::base_implementation_type &,const MutableBufferSequence &,boost::asio::socket_base::message_flags,Handler)' being compiled
with
[
MutableBufferSequence=boost::asio::mutable_buffers_1,
ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>,
Handler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
]
C:\dev\sapphire\boost_1_46_1\boost/asio/basic_stream_socket.hpp(708) : see reference to function template instantiation 'void boost::asio::stream_socket_service::async_receive(boost::asio::detail::reactive_socket_service::implementation_type &,const MutableBufferSequence &,boost::asio::socket_base::message_flags,ReadHandler)' being compiled
with
[
Protocol=boost::asio::ip::tcp,
MutableBufferSequence=boost::asio::mutable_buffers_1,
ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
]
..\..\..\platform_epi\src\connection.cpp(36) : see reference to function template instantiation 'void boost::asio::basic_stream_socket::async_read_some>(const MutableBufferSequence &,ReadHandler)' being compiled
with
[
Protocol=boost::asio::ip::tcp,
Dispatcher=boost::asio::io_service::strand,
Handler=boost::_bi::bind_t,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>,
MutableBufferSequence=boost::asio::mutable_buffers_1,
ReadHandler=boost::asio::detail::wrapped_handler,boost::_bi::list3>,boost::arg<1>,boost::arg<2>>>>
]
Насколько я понимаю, ошибка происходит из строки 36, но я не понимаю, что происходит.Я думаю, что это как-то связано с тем, что bytes_transferred используется как bool, когда он int.Если бы кто-то мог прояснить эту проблему и / или как ее исправить, это было бы великолепно!
Спасибо!