I want to read data from a udp socket asynchronously which is taken as a server socket and is listening on a certain port.
socket_->async_receive_from(
boost::asio::null_buffers(),
sender_endpoint_,
boost::bind(&UdpSocketServer::HandleReceive,
shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred
)
);
the question is: sender_endpoint_ is always 0.0.0.0:0 while received some data from client. when I use boost::asio::buffer(recv_buffer_) in place of boost::aiso::null_buffers(), the sender_endpoint_ comes right. I try to search this wired case in google, but cant figure it out. Since anybody encountered the case before? or anybody can help? thanks very much.