Open marcoippolito opened 6 years ago
You can fix it by:
#define ASIO_STANDALONE 1
void start_receive()
{
socket_.async_receive_from(
asio::buffer(recv_buffer_), remote_endpoint_,
std::bind(&udp_server::handle_receive, this,
std::placeholders::_1,
std::placeholders::_2));
}
But you will get error in ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT macros. There are no support for std::bind.
I have same problem (
Same error here? How to fix it?
You can fix it by:
#define ASIO_STANDALONE 1 void start_receive() { socket_.async_receive_from( asio::buffer(recv_buffer_), remote_endpoint_, std::bind(&udp_server::handle_receive, this, std::placeholders::_1, std::placeholders::_2)); }
But you will get error in ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT macros. There are no support for std::bind.
I have same problem (
looks like, asio::placeholders
will be enabled for boost.bind
. and the compiler flag -DASIO_STANDALONE
indicates, non-boost, standalone version of asio..I suppose.
But you will get error in ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT macros.
The completion-token signature for async_send_to
should look something like void(std::error_code, std::size_t)
handle_send(error_code,size_t)
can you refer to asio document and confirm whether your handlers comply with asio handler's signature requirement?
Same error here? How to fix it?
use std::bind
; Refer to asio's document and confirm whether your handlers comply with asio handler's signature requirement?
yes, using std::bind solves the problem
Hi, in compiling the tutorial example: http://think-async.com/Asio/asio-1.10.6/doc/asio/tutorial/tutdaytime6/src.html
What do I have to do to solve the problem? Marco